Sunday, April 23, 2017

How to Claim Accident in KSA?



May Allah protects you,


If you have car accident in KSA you should follow below steps to make your insurance claim.

Step 1:
Call Najm (9200 00560) and describe how accident was happen Najm will make his analysis and give you a paper narrating how many percent is your or 2nd party fault for the accident.


Step 2:
Take the car to workshop and get 3 quotation of labor cast of the car and parts needed.

Step 3:
Go to your carmaker service center and make quotation of parts.

Step 4:
Go to your bank, get the IBAN number on paper, and stamp by your bank.

Step 5:
Submit all papers to Najm, Najm will submit these papers to Insurance Company and wait for approval then repair your car.


Note:
Never Ever fix your car before Insurance approval (sometime insurance company send someone to re-check the car).
No need to go to Maroor (Traffic Police) for stamp.
No need to go to Insurance Company by yourself.

Thursday, March 9, 2017

Best Things for Hair and Skin

Good things for Hair, Skin


Name
Use For
Axiol Oil

Hair
Miracle cream for night

Skin
Tretinoin cream for baldness

Hair
Minoxidil (5% for men and 2% for women) daily at night

Hair

Best Recipe for Hair

Best Recipe for Hair


Name
Quantity
Details
Mustard Oil
1 Pao
Put it in pan on stove
Onion
1 Onion
Small Pcs
Methi Dana
1 table spoon
Grains
Carrot or Beet Root
1 Carrot
Small Pcs
Lemon
1 whole
With grain and Skin

How to make and use?

:: Put oil in a pan on stove when heated add all ingredients. Heat it for  5-7 minute.  Once cold, strain it. Use it daily. 

:: use it for 15 days and result will be good.


Link: youtube.com Sanam Bloach (The Morning Show) program 8 MAR 2017.

Best Recepie to weight loss



Best Recepie to weight loss. 


Name
Quantity
Details
Suhaga
60 Gram
Burn it on plate it will turn to liquid then dry it.
Black Pepper
15 Gram
Powder
Elava
30 Gram
Powder
Big Cardamom
25 Gram
Grains
Aloe Vera Gel

 only to mix everything

How to make and use?

:: mix all powder and make pills like ‘Hakeem’ by hand using two finger ( small pills) and dry it.

Dosage?

:: Take two tables in the morning and two at night with water.


Link: youtube.com Sanam Bloach (The Morning Show) program 8 MAR 2017.

Wednesday, March 8, 2017

Creating the SetUp for windows Service




Creating the SetUp for windows Service


Adding Installer to Winodws Service.

Step1 : Right Click on Windows Service Page then click add installer.


Step2 : Do the Settings of installer by given below snapshots.






Step3: Add new SetUp Project by Right Click on Soultion > Add Project > Other Project Types> Visual Studio Installer > SetUp Project.


Step4: Add Project Output by right clicking on Application and Select the Primary Project as Windows Service Project.




Step5: Add Custom Action to your project will make you install, uninstall, rollback of service if you do not add this custom action your service will install but will not show in services to start or stop the service.


Step6: After Installing the Service on server Add dependent folders like Images, .html container folders to the location where service is installed so it can use those files if needed.


Monday, October 24, 2016

How to transfer multiple values from one Page to other using Session as Class?





Step1: Page A

StudentsClass object= new StudentsClass()
        {
            Name= txtName.Text,
            Class = txtClass.Text,
       };

Session["Stu"]=object;

Step2: Page B

StudentsClass obj= (StudentsClass)Session["Stu"];

string name = obj.txtName;
string class  = obj.txtClass;



Tuesday, October 4, 2016

How to Query REST API ?



> domain\username:password must be authorize to query to the REST API.
> For POST HttpRequest is content type and use charset=utf-8 to convert.
> For GET HttpRequest is Accept


POST:


Uri address = new Uri(@"https://xx.xx.xx.xx:xxxx/abc/config/anything/");

HttpWebRequest request = WebRequest.CreateDefault(address) as HttpWebRequest;
request.Method = "POST";
request.Headers["Authorization"] = "Basic " + 
Convert.ToBase64String(Encoding.Default.GetBytes(@"domain\username:password"));
request.ContentType = "application/vnd.com.cisco.ise.identity.guestuser.2.0+xml; charset=utf-8";
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });

//Inserting data 

string data="xml data";


byte[] bytes = Encoding.UTF8.GetBytes(data);

request.ContentLength = bytes.Length;
using (Stream requestStream = request.GetRequestStream())
{
  // Send the data.
   requestStream.Write(bytes, 0, bytes.Length);
  requestStream.Close();
 }


Get By Name:


string name="";


Uri address = new Uri(@"https://xx.xx.xx.xx:xxxx/abc/config/anything/name/" +name +" ");


HttpWebRequest request = WebRequest.CreateDefault(address) as HttpWebRequest;

request.Method = "GET";
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes(@"domain\username:password"));
request.Accept = "application/vnd.com.cisco.ise.identity.guestuser.2.0+xml";
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
       
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string s = reader.ReadToEnd();

}

Get All:


Uri address = new Uri(@"https://xx.xx.xx.xx:xxxx/abc/config/anything/ ");


HttpWebRequest request = WebRequest.CreateDefault(address) as HttpWebRequest;

request.Method = "GET";
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes(@"domain\username:password"));
request.Accept = "application/vnd.com.cisco.ise.identity.guestuser.2.0+xml";
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
       
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string s = reader.ReadToEnd();

}

            


Monday, October 3, 2016

How to create a web service ?



Step1: Create the Web Service

Open Visual Studio create new web site. File > New >Website

Add an item as Web Service to the project. Webservice.asmx

Now create some web methods 


 [WebMethod]
 public string GetbyId(string name){}


if the response is in Custom Created Class then return that class object as below
 
[WebMethod]
[System.Xml.Serialization.XmlInclude(typeof(Students))]
 public string GetAll(string name){}


Public Class Student
{
public string name{get; set;}
public string rollnumber{get; set;}
}

Step 2: Publishing the Web Service

To publish the web service the procedure is same as publishing the website because as we created the Web Service under Web Site Project.




Sunday, September 18, 2016

FusionChart with C#,Linq,EntiyFramework,Asp .NET,Xml Best Way.



Step1:

-------------------------------------------Page Html-------------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>FusionChart Test</title
    <script src="FusionChart/fusioncharts.js" type="text/javascript"></script>
    <script src="FusionChart/fusioncharts.charts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:Literal ID="Literal1" runat="server"></asp:Literal>
   
    </div>
    </form>
</body>
</html>


-------------------------------------------------------------------------------------

Step2:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using InfoSoftGlobal;

public partial class FusionChartTest : System.Web.UI.Page
{
  
    Entities ctx = new Entities();

    protected void Page_Load(object sender, EventArgs e)
    {

---------------Getting the required result and save into class-----------------------

        var model = ctx.Table
           
            .Where(o=>o.DateTime.Value.Year==DateTime.Now.Year)

            .GroupBy(o => new
            {
                Month =(int) o.DateTime.Value.Month,
                Year = o.DateTime.Value.Year
            })
            .Select(g => new SomeClass
            {
                Month = g.Key.Month,
                Year = g.Key.Year,
                Value = g.Count()
            })
            .OrderByDescending(a => a.Year)
            .ThenByDescending(a => a.Month)
            .ToList();

         List<SomeClass> list=new List<SomeClass>(model);
-------------------------------------------------------------------------------------



--------------------------Forming the xml to display as chart------------------------

         StringBuilder xmlData = new StringBuilder();

         xmlData.Append("<chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='0' formatNumberScale='0' showBorder='1'>");
     
        foreach (var item in list)
       {
         xmlData.AppendFormat("<set label='{0}' value='{1}' />", item.Month + "," + item.Year, item.Value);
       }

        xmlData.Append ( "</chart>"); 
       
        Literal1.Text = InfoSoftGlobal.FusionCharts.RenderChart("FusionChart/Charts/line.swf", "", xmlData.ToString(), "browser_share", "640", "340", false, true);
    }
-------------------------------------------------------------------------------------
  

}

--------------------------------Custom Class to Save the Result----------------------

public class SomeClass
{
    public int Month { get; set; }
    public int Year { get; set; }
    public int Value { get; set; }
}
-------------------------------------------------------------------------------------


Secure you Asp .NET by Web.config & Global.ascx?

Add to Global.ascx protected void Application_BeginRequest(object sender,EventArgs e)     {         //to remove x frame         Resp...