public void GetWarehouseDetailByID() { CustomProfile profile = CustomProfile.GetProfile(); iWarehouseClient Warehouseclient = new iWarehouseClient(); V_WMS_GetWarehouseDetails Wdetail = new V_WMS_GetWarehouseDetails(); Wdetail = Warehouseclient.GetWarehouseDetailByID(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr); FillCompany(); if (Wdetail.CompanyID != null) { ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(Wdetail.CompanyID.ToString())); } GetCustomerddl(long.Parse(Wdetail.CompanyID.ToString())); if (Wdetail.CustomerID != null) { ddlcustomer.SelectedIndex = ddlcustomer.Items.IndexOf(ddlcustomer.Items.FindByValue(Wdetail.CustomerID.ToString())); } if (Wdetail.Code != null) { txtcode.Text = Wdetail.Code.ToString(); } if (Wdetail.WarehouseName != null) { txtwarehousename.Text = Wdetail.WarehouseName.ToString(); } if (Wdetail.Type != null) { ddltype.SelectedIndex = ddltype.Items.IndexOf(ddltype.Items.FindByText(Wdetail.Type.ToString())); } if (Wdetail.Description != null) { txtdescription.Text = Wdetail.Description.ToString(); } if (Wdetail.Remark != null) { txtremark.Text = Wdetail.Remark.ToString(); } hdnNewCustomerID.Value = Wdetail.CustomerID.ToString(); hdncompanyid.Value = Wdetail.CompanyID.ToString(); Session.Add("CompanyID", Wdetail.CompanyID.ToString()); hdnWarehouseName.Value = Wdetail.WarehouseName.ToString(); Session["WarehouseName"] = Wdetail.WarehouseName.ToString(); Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + Wdetail.County + "','" + Wdetail.State + "');", true); string RActive = Wdetail.Active.ToString(); if (RActive == "Yes") { rbtYes.Checked = true; } else { rbtNo.Checked = true; } hdncompanyid.Value = Wdetail.CompanyID.ToString(); hdncustomerid.Value = Wdetail.CustomerID.ToString(); // UCAddress1.FillAddressByObjectNameReferenceID("Warehouse", long.Parse(hdnwarehouseID.Value), "Warehouse"); // UCContactPerson1.FillContactPersonByObjectNameReferenceID("Warehouse", long.Parse(hdnwarehouseID.Value), "Warehouse"); }