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