public static string WMSaveRequestHead(object objCon, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iWarehouseClient Warehouseclient = new iWarehouseClient(); mSection sec = new mSection(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objCon; sec.Name = dictionary["Name"].ToString(); sec.SortCode = long.Parse(dictionary["SortCode"].ToString()); sec.Description = dictionary["description"].ToString(); sec.CompanyID = long.Parse(dictionary["CompanyId"].ToString()); sec.CustomerID = long.Parse(dictionary["CustomerID"].ToString()); sec.PathID = long.Parse(dictionary["hdnpassageID"].ToString()); if (State == "Edit") { sec.ID = Convert.ToInt64(HttpContext.Current.Session["PassageID"].ToString()); sec.CreatedBy = profile.Personal.UserID; sec.CreationDate = DateTime.Now; long Section = Warehouseclient.SaveWarehouseSection(sec, profile.DBConnection._constr); } else { sec.CreatedBy = profile.Personal.UserID; sec.CreationDate = DateTime.Now; long SectionID = Warehouseclient.SaveWarehouseSection(sec, profile.DBConnection._constr); } result = "Section saved successfully"; } catch { result = "Some error occurred"; } finally { Warehouseclient.Close(); } return(result); }