Exemplo n.º 1
0
        protected void btn_merchant_Click(object sender, EventArgs e)
        {
            BusinessEntitiesBS.merchantObj merchantValues = new BusinessEntitiesBS.merchantObj();
            merchantValues.mName    = txt_mName.Text;
            merchantValues.mType    = ddl_mType.SelectedItem.ToString();
            merchantValues.mAddress = txt_mAddress.InnerText.ToString();
            merchantValues.mPhno    = txt_mPhno.Text;
            merchantValues.mLoginId = txt_mLoginId.Text;
            merchantValues.mPwd     = CLASS.PasswordEncryption.EncryptIt(txt_mPwd.Text);
            merchantValues.mArea    = areaAc.AreaId;
            merchantValues.mCatid   = Int32.Parse(ddlCatagoryMer.SelectedValue);

            try
            {
                IAdmin insertMerchant = new AdminItems();
                int    inserted       = insertMerchant.insertMerchant(merchantValues);
                if (inserted != -1)
                {
                    lbl_merchantStatus.Text = "Merchant Added";
                    getMerchants();
                    ClearCache();
                }
                else
                {
                    lbl_merchantStatus.Text = "Merchant Not Added";
                }
            }
            catch (Exception ex)
            {
                lbl_merchantStatus.Text = HardCodedValues.BuddaResource.CatchBlockError + ex.Message;
            }
        }
Exemplo n.º 2
0
        protected void btn_merchant_Click(object sender, EventArgs e)
        {
            BusinessEntitiesBS.merchantObj merchantValues = new BusinessEntitiesBS.merchantObj();
            merchantValues.mName = txt_mName.Text;
            merchantValues.mType = ddl_mType.SelectedItem.ToString();
            merchantValues.mAddress = txt_mAddress.InnerText.ToString();
            merchantValues.mPhno = txt_mPhno.Text;
            merchantValues.mLoginId = txt_mLoginId.Text;
            merchantValues.mPwd = CLASS.PasswordEncryption.EncryptIt(txt_mPwd.Text);
            merchantValues.mArea = areaAc.AreaId;
            merchantValues.mCatid = Int32.Parse(ddlCatagoryMer.SelectedValue);

            try
            {
                IAdmin insertMerchant = new AdminItems();
                int inserted = insertMerchant.insertMerchant(merchantValues);
                if (inserted != -1)
                {
                    lbl_merchantStatus.Text = "Merchant Added";
                    getMerchants();
                    ClearCache();
                }
                else
                {
                    lbl_merchantStatus.Text = "Merchant Not Added";
                }
            }
            catch (Exception ex)
            {
                lbl_merchantStatus.Text = HardCodedValues.BuddaResource.CatchBlockError + ex.Message;
            }
        }
Exemplo n.º 3
0
        public int insertMerchantDA(BusinessEntitiesBS.merchantObj merchantValues)
        {
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[8];
                //Merchant parameters
                sqlParams[0] = new SqlParameter("@name", merchantValues.mName);
                sqlParams[1] = new SqlParameter("@type", merchantValues.mType);
                sqlParams[2] = new SqlParameter("@address", merchantValues.mAddress);
                sqlParams[3] = new SqlParameter("@phno", merchantValues.mPhno);
                sqlParams[4] = new SqlParameter("@loginid", merchantValues.mLoginId);
                sqlParams[5] = new SqlParameter("@pwd", merchantValues.mPwd);
                sqlParams[6] = new SqlParameter("@areaId", Int32.Parse(merchantValues.mArea));
                sqlParams[7] = new SqlParameter("@catId", merchantValues.mCatid);

                int count = DBHelper.ExecuteNonQuery(DBCommon.ConnectionString, "USP_INSERT_MERCHANT", sqlParams);
                return(count);
            }
            catch (SqlException exc)
            {
                return(-1);

                throw exc;
            }
        }
Exemplo n.º 4
0
 public int insertMerchant(BusinessEntitiesBS.merchantObj merchantValues)
 {
     try
     {
         IAdminDA merchantInsert = new DataAccessBS.AdminClasses.AdminDA();
         int      merchantChk    = merchantInsert.insertMerchantDA(merchantValues);
         return(merchantChk);
     }
     catch
     {
         return(-1);
     }
 }