Exemple #1
0
        private void dgvMerchantManage_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (headval)
                {
                    if (dgvMerchantManage.Columns[e.ColumnIndex].Name == "Active")
                    {
                        bool isactive = Convert.ToBoolean(dgvMerchantManage.Rows[e.RowIndex].Cells[7].Value.ToString());
                        if (isactive == true)
                        {
                            _bomermng.ActiveStatus = false;
                        }
                        else
                        {
                            _bomermng.ActiveStatus = true;
                        }
                        _bomermng.MerchantId = Convert.ToInt32(dgvMerchantManage.Rows[e.RowIndex].Cells[0].Value.ToString());

                        _bomermng.UpdatedBy   = loginID;
                        _bomermng.UpdatedDate = DateTime.UtcNow;
                        _bomermng.Event       = "UpdateStatus";
                        MessageBox.Show(Common.Message("Merchant profile is", _bamermng.Update(_bomermng)));
                        FillDataGridView();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
     {
         Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
         if (validateForm())
         {
             _bommng.MerchantId      = Convert.ToInt32(ViewState["querystring"]);
             _bommng.MerchantName    = txtMerchantName.Text;
             _bommng.Password        = Common.EncryptPassword(txtpassword.Text);
             _bommng.EmailId         = txtEmailId.Text;
             _bommng.Telephone       = txtTelephone.Text;
             _bommng.MerchantLevelId = Convert.ToInt32(drpMerchantLevel.SelectedItem.Value);
             _bommng.StartDate       = Convert.ToDateTime(txtStartDate.Text);
             _bommng.EndDate         = Convert.ToDateTime(txtEndDate.Text);
             _bommng.ActiveStatus    = Convert.ToBoolean(ddlActiveStatus.SelectedItem.Value);
             _bommng.UpdatedBy       = adminId;
             _bommng.UpdatedDate     = DateTime.UtcNow;
             _bommng.Event           = "Update";
             int result = _bammng.Update(_bommng);
             if (result == 2)
             {
                 ShowMessage("Merchant updated successfully", MessageType.Success);
             }
         }
     }
 }
Exemple #3
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
                {
                    Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                    if (fuMerchantPicture.HasFile)
                    {
                        lblPicture.Text = Path.GetFileName(Common.AppendTimeStamp(fuMerchantPicture.PostedFile.FileName));
                        fuMerchantPicture.PostedFile.SaveAs(Server.MapPath("~/img_merchant/") + lblPicture.Text);
                    }
                    BOMerchantManage _bomerchant = new BOMerchantManage();
                    BAMerchantManage _bamerchant = new BAMerchantManage();
                    _bomerchant.MerchantId   = merchantId;
                    _bomerchant.MerchantName = txtMerchantName.Text;
                    _bomerchant.UserName     = txtUserName.Text;
                    _bomerchant.Password     = Common.Encryptdata(txtpassword.Text);
                    if (drpState.SelectedItem != null)
                    {
                        _bomerchant.StateId = Convert.ToInt32(drpState.SelectedItem.Value);
                    }
                    else
                    {
                        _bomerchant.StateId = 0;
                    }

                    _bomerchant.Telephone   = txtTelephone.Text;
                    _bomerchant.Brand       = txtBrand.Text;
                    _bomerchant.Picture     = lblPicture.Text;
                    _bomerchant.About       = txtAboutMerchant.Text;
                    _bomerchant.IsActive    = true;
                    _bomerchant.IsDelete    = false;
                    _bomerchant.StartDate   = DateTime.UtcNow;
                    _bomerchant.EndDate     = DateTime.UtcNow;
                    _bomerchant.CreatedBy   = merchantId;
                    _bomerchant.CreatedDate = DateTime.UtcNow;
                    _bomerchant.UpdatedBy   = merchantId;
                    _bomerchant.UpdatedDate = DateTime.UtcNow;
                    _bomerchant.Event       = "UpdateBySelf";
                    int returnvalue = _bamerchant.Update(_bomerchant);
                    if (returnvalue == 2)
                    {
                        ShowMessage("Updated successfully", MessageType.Success);
                    }
                    else if (returnvalue == -2)
                    {
                        ShowMessage("UserName already taken", MessageType.Info);
                    }
                }
            }
            catch (Exception ex)
            {
                Common.LogError(ex);
                ShowMessage("Some technical error", MessageType.Warning);
            }
        }
        protected void MerchantLevelUpdate(int levelid)
        {
            try
            {
                if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
                {
                    Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());

                    BOMerchantManage _bomerchant = new BOMerchantManage();
                    BAMerchantManage _bamerchant = new BAMerchantManage();
                    _bomerchant.MerchantId      = Convert.ToInt32(Common.Decryptdata(ViewState["mid"].ToString()));
                    _bomerchant.MerchantLevelId = levelid;
                    _bomerchant.MerchantName    = "";
                    _bomerchant.UserName        = "";
                    _bomerchant.Password        = "";
                    _bomerchant.StateId         = 0;
                    _bomerchant.Telephone       = "";
                    _bomerchant.Brand           = "";
                    _bomerchant.Picture         = "";
                    _bomerchant.About           = "";
                    _bomerchant.IsActive        = true;
                    _bomerchant.IsDelete        = false;
                    _bomerchant.StartDate       = DateTime.UtcNow;
                    _bomerchant.EndDate         = DateTime.UtcNow;
                    _bomerchant.CreatedBy       = 0;
                    _bomerchant.CreatedDate     = DateTime.UtcNow;
                    _bomerchant.UpdatedBy       = 0;
                    _bomerchant.UpdatedDate     = DateTime.UtcNow;
                    _bomerchant.Event           = "UpdateLevelAfterRegistrer";
                    int returnvalue = _bamerchant.Update(_bomerchant);
                }
            }
            catch (Exception ex)
            {
                Common.LogError(ex);
                ShowMessage("Some technical error", MessageType.Warning);
            }
        }