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