Exemplo n.º 1
0
        /// <summary>
        /// This method is used to save store details.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void butSave_Click(object sender, EventArgs e)
        {
            try
            {
                StoreInfo Store = new StoreInfo();
                Store.StoreName = txtStoreName.Text;
                Store.StoreCode = txt_storecode.Text;
                Store.StoreTypeID = optbtn_Vendor.Checked ? 0 : int.Parse(drpStoreType.SelectedValue.ToString());
                Store.Company = optbtn_Vendor.Checked ? 0 : int.Parse(drpCompany.SelectedValue);
                Store.Country = int.Parse(drpCountry.SelectedValue);
                Store.State = int.Parse(drpState.SelectedValue);
                Store.City = int.Parse(drpCity.SelectedValue);
                Store.Address = txt_address.Value;
                Store.Zipcode = txt_zipcode.Value;
                Store.Description = txt_description.Value;
                Store.IsActive = chk_active.Checked == true ? "1" : "0";
                Store.UserId = Session["UserID"].ToString();
                BL_CreateStore.CreateStore(Store, StoreCode == string.Empty ? 0 : 1, optbtn_Vendor.Checked ? 1 : 0);

                Reset();
                parentObject.GetStoreDetails();
            }
            catch (Exception Ex)
            {
                AjaxControlToolkit.ToolkitScriptManager.RegisterClientScriptBlock(this, GetType(), "Dupicate", "alert('" + Ex.Message.ToString() + "')", true);
                txt_storecode.Focus();
                mpecreateStore.Show();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method is used to add store details.
        /// </summary>
        /// <param name="Store"></param>
        public static void CreateStore(StoreInfo Store, int Mode, int isVendor)
        {
            try
            {
                clsParameterCollection ParameterCollection = new clsParameterCollection();
                ParameterCollection.ProcedureName = "BS_Store_AddStore";
                ParameterCollection.Add(new clsParameter("@StoreName", Store.StoreName));
                ParameterCollection.Add(new clsParameter("@Description", Store.Description));
                ParameterCollection.Add(new clsParameter("@Address", Store.Address));
                ParameterCollection.Add(new clsParameter("@CompanyID", Store.Company));
                ParameterCollection.Add(new clsParameter("@countryID", Store.Country));
                ParameterCollection.Add(new clsParameter("@StateID", Store.State));
                ParameterCollection.Add(new clsParameter("@CityID", Store.City));
                ParameterCollection.Add(new clsParameter("@Zipcode", Store.Zipcode));
                ParameterCollection.Add(new clsParameter("@IsActive", Store.IsActive));
                ParameterCollection.Add(new clsParameter("@StoreCode", Store.StoreCode));
                ParameterCollection.Add(new clsParameter("@UserID", Store.UserId));
                ParameterCollection.Add(new clsParameter("@Mode", Mode));
                ParameterCollection.Add(new clsParameter("@StoreTypeID", Store.StoreTypeID));
                ParameterCollection.Add(new clsParameter("@isVendor", isVendor));
                DataAccess.ExecuteNonQuerySp(ParameterCollection);
            }
            catch (Exception Ex)
            {
                if (!Ex.Message.Contains("User Define:"))
                    BL_Exception.WriteLog(Ex);

                throw Ex;
            }
        }