protected void BindFloarList(long Building)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            grdWareFloar.DataSource = Warehouseclient.GetWarehouseFloar(Building, profile.DBConnection._constr);
            grdWareFloar.DataBind();
        }
Ejemplo n.º 2
0
        protected void BindSectionList(long PassageID)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            grdsection.DataSource = Warehouseclient.GetWarehouseSection(PassageID, profile.DBConnection._constr);
            grdsection.DataBind();
        }
        protected void BindPassageList(long FloarID)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            grdpassage.DataSource = Warehouseclient.GetWarehousePassage(FloarID, profile.DBConnection._constr);
            grdpassage.DataBind();
        }
        protected void BindBuildingList(long WarehouseID)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            gvBuilding.DataSource = Warehouseclient.GetWarehouseBuilding(WarehouseID, profile.DBConnection._constr);
            gvBuilding.DataBind();
        }
Ejemplo n.º 5
0
        protected void BindShelfList(long SectionID)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            grdshelf.DataSource = Warehouseclient.GetWarehouseShelf(SectionID, profile.DBConnection._constr);
            grdshelf.DataBind();
        }
Ejemplo n.º 6
0
        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");
        }
Ejemplo n.º 7
0
        public static string PMSaveWLocation(object WLocationInfo, string LocationID)
        {
            string           result          = "";
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            mLocation        loc             = new mLocation();
            tSKUTransaction  skutrans        = new tSKUTransaction();

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

                loc.ShelfID             = long.Parse(dictionary["ShelfID"].ToString());
                loc.Code                = dictionary["LocationCode"].ToString();
                loc.AliasCode           = dictionary["AliasCode"].ToString();
                loc.SortCode            = long.Parse(dictionary["SortCode"].ToString());
                loc.LocationType        = dictionary["LocationType"].ToString();
                loc.CapacityIn          = long.Parse(dictionary["CapacityIn"].ToString());
                loc.Capacity            = decimal.Parse(dictionary["Capacity"].ToString());
                loc.VelocityType        = dictionary["VelocityType"].ToString();
                loc.CompanyID           = long.Parse(dictionary["CompanyID"].ToString());
                loc.CustomerID          = long.Parse(dictionary["CustomerID"].ToString());
                loc.Active              = dictionary["Active"].ToString().Trim();
                loc.WarehouseID         = long.Parse(dictionary["WarehouseID"].ToString());
                skutrans.ClosingBalance = 0;
                skutrans.InQty          = 0;
                skutrans.OutQty         = 0;
                skutrans.CreatedBy      = profile.Personal.UserID;
                skutrans.CreationDate   = DateTime.Now;
                skutrans.CompanyID      = long.Parse(dictionary["CompanyID"].ToString());
                skutrans.CustomerID     = long.Parse(dictionary["CustomerID"].ToString());
                if (LocationID != "0")
                {
                    loc.ID           = long.Parse(LocationID);
                    loc.CreatedBy    = profile.Personal.UserID;
                    loc.CreationDate = DateTime.Now;
                    long LocID = Warehouseclient.SaveWarehouseLocation(loc, profile.DBConnection._constr);
                }
                else
                {
                    loc.AvailableBalance = 0;
                    loc.CreatedBy        = profile.Personal.UserID;
                    loc.CreationDate     = DateTime.Now;
                    long LocID = Warehouseclient.SaveWarehouseLocation(loc, profile.DBConnection._constr);
                    skutrans.LocationID = LocID;
                    Warehouseclient.AddRecordInSkuTransaction(skutrans, profile.DBConnection._constr);
                }
                result = "Location saved successfully";
            }
            catch { result = "Some error occurred"; }
            finally { Warehouseclient.Close(); }

            return(result);
        }
Ejemplo n.º 8
0
        public void FillLocationGrid(long WarehouseID)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            DataSet          ds = new DataSet();

            ds = Warehouseclient.GetWarehouseLocationByID(WarehouseID, profile.DBConnection._constr);
            GVLocation.DataSource = ds;
            // GVLocation.DataSource = Warehouseclient.GetWarehouseLocation(WarehouseID, profile.DBConnection._constr);
            GVLocation.DataBind();
        }
Ejemplo n.º 9
0
        public static string ChkDuplicateSortCode(string SortCode, string WarehouseID)
        {
            string           result          = "";
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            CustomProfile    profile         = CustomProfile.GetProfile();
            long             count           = Warehouseclient.CheckDuplicateSortCode(long.Parse(SortCode), long.Parse(WarehouseID), profile.DBConnection._constr);

            if (count >= 1)
            {
                result = "Duplicate Found";
            }
            return(result);
        }
Ejemplo n.º 10
0
        protected void GetCapacityIn()
        {
            ddlcapacityin.Items.Clear();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            CustomProfile    profile         = CustomProfile.GetProfile();

            ddlcapacityin.DataSource = Warehouseclient.GetCapacityIn(profile.DBConnection._constr);
            ddlcapacityin.DataBind();
            ListItem lst = new ListItem {
                Text = "-Select-", Value = "0"
            };

            ddlcapacityin.Items.Insert(0, lst);
        }
Ejemplo n.º 11
0
        protected void FillLocationType()
        {
            ddllocationtype.Items.Clear();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            CustomProfile    profile         = CustomProfile.GetProfile();

            ddllocationtype.DataSource = Warehouseclient.GetLocationType(profile.DBConnection._constr);
            ddllocationtype.DataBind();
            ListItem lst = new ListItem {
                Text = "-Select-", Value = "0"
            };

            ddllocationtype.Items.Insert(0, lst);
        }
Ejemplo n.º 12
0
        public void GetWarehouseAddress()
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            tAddress         getaddr         = new tAddress();

            getaddr               = Warehouseclient.GetWarehouseAddress(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr);
            txtCAddress1.Text     = getaddr.AddressLine1;
            txtAddress2.Text      = getaddr.AddressLine2;
            txtZipCode.Text       = getaddr.Zipcode;
            hdnCountry.Value      = getaddr.County;
            hdncountryState.Value = getaddr.State;
            txtCity.Text          = getaddr.City;
            //Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + getaddr.County + "','" + getaddr.State + "');", true);
        }
Ejemplo n.º 13
0
        protected void FillWarehouse()
        {
            ddlWarehouse.Items.Clear();
            iWarehouseClient Warehouse = new iWarehouseClient();
            CustomProfile    profile   = CustomProfile.GetProfile();
            long             UserID    = profile.Personal.UserID;

            ddlWarehouse.DataSource = Warehouse.GetWarehousebyUserID(UserID, profile.DBConnection._constr);
            ddlWarehouse.DataBind();
            ListItem lst = new ListItem {
                Text = "-Select-", Value = "0"
            };

            ddlWarehouse.Items.Insert(0, lst);
            Warehouse.Close();
        }
        protected void GetBuildingByID()
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            try
            {
                mWarehouseBuilding warebuilding = new mWarehouseBuilding();
                warebuilding = Warehouseclient.GetWareBuildingByID(long.Parse(hdnbuilding.Value), profile.DBConnection._constr);

                if (warebuilding.Name != null)
                {
                    txtbuildname.Text = warebuilding.Name.ToString();
                }
                if (warebuilding.SortCode != null)
                {
                    txtsortcode.Text = warebuilding.SortCode.ToString();
                }
                if (warebuilding.Capacity != null)
                {
                    txtcapacity.Text = warebuilding.Capacity.ToString();
                }
                if (warebuilding.Description != null)
                {
                    txtdescription.Text = warebuilding.Description.ToString();
                }
                if (warebuilding.CustomerID != null)
                {
                    hdncustomerID.Value = warebuilding.CustomerID.ToString();
                }
                hdnCompanyID.Value = warebuilding.CompanyID.ToString();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "AddEditSearchContact", "GetContactDetailByContactID");
            }
            finally
            {
                Warehouseclient.Close();
            }
        }
        protected void GetFloarByID()
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            try
            {
                mFloar Floar = new mFloar();
                Floar = Warehouseclient.GetWarehouseFloarbyID(long.Parse(hdnfloarID.Value), profile.DBConnection._constr);

                if (Floar.Name != null)
                {
                    txtfloarname.Text = Floar.Name.ToString();
                }
                if (Floar.SortCode != null)
                {
                    txtsortcode.Text = Floar.SortCode.ToString();
                }
                if (Floar.Capacity != null)
                {
                    txtcapacity.Text = Floar.Capacity.ToString();
                }
                if (Floar.Description != null)
                {
                    txtdescription.Text = Floar.Description.ToString();
                }
                if (Floar.CustomerID != null)
                {
                    hdncustomerID.Value = Floar.CustomerID.ToString();
                }
                hdnCompanyID.Value = Floar.CompanyID.ToString();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "WarehouseFloar", "GetFloarByID");
            }
            finally
            {
                Warehouseclient.Close();
            }
        }
        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);
        }
        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);
        }
Ejemplo n.º 18
0
        protected void WarehouseGridBind()
        {
            iWarehouseClient WarehouseClient = new iWarehouseClient();

            try
            {
                CustomProfile profile   = CustomProfile.GetProfile();
                long          CompanyID = profile.Personal.CompanyID;
                List <V_WMS_GetWarehouseDetails> warehouselst = new List <V_WMS_GetWarehouseDetails>();
                warehouselst = WarehouseClient.GetWarehouseList(CompanyID, profile.DBConnection._constr).ToList();
                warehouselst = warehouselst.Where(w => w.CompanyID == CompanyID).ToList();
                grdWarehouseList.DataSource = warehouselst;
                grdWarehouseList.DataBind();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Warehouse Master", "MainCustomerGridBind");
            }
            finally
            {
                WarehouseClient.Close();
            }
        }
        protected void GetPassageID()
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();

            try
            {
                mPathway path = new mPathway();
                path = Warehouseclient.GetWarehousePassageByID(long.Parse(hdnpassageID.Value), profile.DBConnection._constr);

                if (path.Name != null)
                {
                    txtpassage.Text = path.Name.ToString();
                }
                if (path.SortCode != null)
                {
                    txtsortcode.Text = path.SortCode.ToString();
                }
                if (path.Description != null)
                {
                    txtdescription.Text = path.Description.ToString();
                }
                if (path.CustomerID != null)
                {
                    hdncustomerID.Value = path.CustomerID.ToString();
                }
                hdnCompanyID.Value = path.CompanyID.ToString();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "WarehousePassage", "GetPassageID");
            }
            finally
            {
                Warehouseclient.Close();
            }
        }
Ejemplo n.º 20
0
        public void GetLocationDetailByID(long LocationID, long WarehouseID)
        {
            CustomProfile                profile         = CustomProfile.GetProfile();
            iWarehouseClient             Warehouseclient = new iWarehouseClient();
            V_WMS_GetWareLocationByLocID Location        = new V_WMS_GetWareLocationByLocID();

            Location = Warehouseclient.GetWarehouseLocByID(LocationID, WarehouseID, profile.DBConnection._constr);
            if (Location.Code != null)
            {
                txtlocationCode.Text = Location.Code.ToString();
            }
            if (Location.AliasCode != null)
            {
                txtaliascode.Text = Location.AliasCode.ToString();
            }
            if (Location.SortCode != null)
            {
                txtsortCode.Text = Location.SortCode.ToString();
            }
            if (Location.Capacity != null)
            {
                txtcapacity.Text = Location.Capacity.ToString();
            }
            if (Location.LocationType != null)
            {
                ddllocationtype.SelectedIndex = ddllocationtype.Items.IndexOf(ddllocationtype.Items.FindByValue(Location.LocationType.ToString()));
            }
            if (Location.CapacityIn != null)
            {
                ddlcapacityin.SelectedIndex = ddlcapacityin.Items.IndexOf(ddlcapacityin.Items.FindByValue(Location.CapacityIn.ToString()));
            }
            if (Location.VelocityType != null)
            {
                ddlvelocityType.SelectedIndex = ddlvelocityType.Items.IndexOf(ddlvelocityType.Items.FindByValue(Location.VelocityType.ToString()));
            }
            if (Location.shelfID != null)
            {
                hdnShelfID.Value = Location.shelfID.ToString();
            }
            if (Location.Building != null)
            {
                txtbuilding.Text = Location.Building.ToString();
            }
            if (Location.Floar != null)
            {
                txtfloar.Text = Location.Floar.ToString();
            }
            if (Location.Passage != null)
            {
                txtpathway.Text = Location.Passage.ToString();
            }
            if (Location.Section != null)
            {
                txtsection.Text = Location.Section.ToString();
            }
            if (Location.Shelf != null)
            {
                txtshelf.Text = Location.Shelf.ToString();
            }
            if (Location.Active.Trim() == "Yes")
            {
                radiochannelY.Checked = true;
            }
            else
            {
                radiochannelN.Checked = true;
            }
        }
Ejemplo n.º 21
0
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            mWarehouseMaster WHDetail        = new mWarehouseMaster();
            tAddress         address         = new tAddress();

            if (hdnstate.Value == "Edit")
            {
                WHDetail = Warehouseclient.GetWarehouseMasterByID(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr);
                address  = Warehouseclient.GetWarehouseAddress(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr);
            }
            WHDetail.Code          = txtcode.Text.ToString();
            WHDetail.WarehouseName = txtwarehousename.Text.ToString();
            WHDetail.Type          = ddltype.SelectedItem.Text;
            WHDetail.Description   = txtdescription.Text.ToString();
            WHDetail.Remark        = txtremark.Text.ToString();
            WHDetail.Active        = "No";
            if (rbtYes.Checked == true)
            {
                WHDetail.Active = "Yes";
            }
            WHDetail.CompanyID = long.Parse(hdncompanyid.Value);
            if (hdncustomerid.Value != "")
            {
                WHDetail.CustomerID = long.Parse(hdncustomerid.Value);
            }
            else
            {
                WHDetail.CustomerID = long.Parse(hdnNewCustomerID.Value);
            }
            WHDetail.CreatedBy    = profile.Personal.UserID;
            WHDetail.CreationDate = DateTime.Now;
            address.AddressLine1  = txtCAddress1.Text.ToString();
            address.AddressLine2  = txtAddress2.Text.ToString();
            address.Zipcode       = txtZipCode.Text.ToString();
            address.County        = hdnCountry.Value;
            address.State         = hdncountryState.Value;
            address.City          = txtCity.Text.ToString();
            address.ObjectName    = "Warehouse";
            address.Active        = "Y";
            address.CreatedBy     = profile.Personal.UserID.ToString();
            address.CreationDate  = DateTime.Now;
            address.CompanyID     = long.Parse(hdncompanyid.Value);
            address.AddressType   = "Warehouse";
            if (hdnstate.Value == "Edit")
            {
                WHDetail.ModifiedBy      = profile.Personal.UserID;
                WHDetail.ModifiedDate    = DateTime.Now;
                address.LastModifiedBy   = profile.Personal.UserID.ToString();
                address.LastModifiedDate = DateTime.Now;
                long WarehouseID = Warehouseclient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr);
                address.ReferenceID = WarehouseID;
                long AddressID = Warehouseclient.SaveWarehouseAddress(address, profile.DBConnection._constr);
                UCContactPerson1.FinalSaveContactPerson("Warehouse", long.Parse(hdnwarehouseID.Value));
                UCContactPerson1.ClearContactPerson("Warehouse");
                WebMsgBox.MsgBox.Show("Record Updated successfully");
            }
            else
            {
                long WarehouseID = Warehouseclient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr);
                address.ReferenceID  = WarehouseID;
                hdnwarehouseID.Value = WarehouseID.ToString();
                long AddressID = Warehouseclient.SaveWarehouseAddress(address, profile.DBConnection._constr);
                UCContactPerson1.FinalSaveContactPerson("Warehouse", long.Parse(hdnwarehouseID.Value));
                UCContactPerson1.ClearContactPerson("Warehouse");
                WebMsgBox.MsgBox.Show("Record saved successfully");
            }
            clear();
            Response.Redirect("WarehouseMaster.aspx");
        }
Ejemplo n.º 22
0
        protected void btncustomernext_Click(object sender, System.EventArgs e)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient WarehouseClient = new iWarehouseClient();

            try
            {
                mWarehouseMaster WHDetail = new mWarehouseMaster();
                tAddress         address  = new tAddress();
                WHDetail.Code          = txtcode.Text.ToString();
                WHDetail.WarehouseName = txtwarehousename.Text.ToString();
                WHDetail.Type          = ddltype.SelectedItem.Text;
                WHDetail.Description   = txtdescription.Text.ToString();
                WHDetail.Remark        = txtremark.Text.ToString();
                WHDetail.Active        = "No";
                if (rbtYes.Checked == true)
                {
                    WHDetail.Active = "Yes";
                }
                WHDetail.CompanyID     = long.Parse(hdncompanyid.Value);
                WHDetail.CustomerID    = long.Parse(hdncustomerid.Value);
                WHDetail.CreatedBy     = profile.Personal.UserID;
                WHDetail.CreationDate  = DateTime.Now;
                address.AddressLine1   = txtCAddress1.Text.ToString();
                address.AddressLine2   = txtAddress2.Text.ToString();
                address.Zipcode        = txtZipCode.Text.ToString();
                address.County         = hdnCountry.Value;
                address.State          = hdncountryState.Value;
                address.City           = txtCity.Text.ToString();
                address.ObjectName     = "Warehouse";
                address.Active         = "Y";
                address.CreatedBy      = profile.Personal.UserID.ToString();
                address.CreationDate   = DateTime.Now;
                address.CompanyID      = long.Parse(hdncompanyid.Value);
                address.AddressType    = "Warehouse";
                hdnWarehouseName.Value = txtwarehousename.Text.ToString();

                Session["WarehouseName"] = txtwarehousename.Text.ToString();
                long WarehouseID = 0;
                WarehouseID         = WarehouseClient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr);
                address.ReferenceID = WarehouseID;
                long AddressID = WarehouseClient.SaveWarehouseAddress(address, profile.DBConnection._constr);
                hdnwarehouseID.Value = WarehouseID.ToString();
                Session.Add("CompanyID", hdncompanyid.Value);
                if (hdnwarehouseID.Value != "0")
                {
                    ActiveTab("Next");
                    btncustomernext.Visible = false;
                }
                else
                {
                    WebMsgBox.MsgBox.Show("Error Occured");
                }
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Warehouse Master", "Buttonnextsave");
            }
            finally
            {
            }
        }