コード例 #1
0
        public static string WMSaveRequestHead(object objCon, string State)
        {
            string           result          = "";
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            mFloar           floar           = new mFloar();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objCon;

                floar.Name        = dictionary["Name"].ToString();
                floar.SortCode    = long.Parse(dictionary["SortCode"].ToString());
                floar.Capacity    = decimal.Parse(dictionary["Capacity"].ToString());
                floar.Description = dictionary["description"].ToString();
                floar.CompanyID   = long.Parse(dictionary["CompanyId"].ToString());
                floar.CustomerID  = long.Parse(dictionary["CustomerID"].ToString());
                floar.BuildingID  = long.Parse(dictionary["BuildingID"].ToString());

                if (State == "Edit")
                {
                    floar.ID           = Convert.ToInt64(HttpContext.Current.Session["FloarID"].ToString());
                    floar.CreatedBy    = profile.Personal.UserID;
                    floar.CreationDate = DateTime.Now;
                    long FloarID = Warehouseclient.SaveWarehouseFloar(floar, profile.DBConnection._constr);
                }
                else
                {
                    floar.CreatedBy    = profile.Personal.UserID;
                    floar.CreationDate = DateTime.Now;
                    long FloarID = Warehouseclient.SaveWarehouseFloar(floar, profile.DBConnection._constr);
                }
                result = "Floar saved successfully";
            }
            catch { result = "Some error occurred"; }
            finally { Warehouseclient.Close(); }

            return(result);
        }