private DateTime SelectMerchantValidDate(int merchantId) { BAMerchantManage _bamermng = new BAMerchantManage(); DateTime validdate = _bamermng.SelectValiddate("GetValidDate", merchantId); return(validdate); }
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 Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["Merchantid"] != null) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); FilldrpCountry(); BAMerchantManage _bamermng = new BAMerchantManage(); BOMerchantManage mnag = (BOMerchantManage)Session["merchantDetail"]; BOMerchantManage _bomerchantDetail = _bamermng.SelectMerchantLogin("MerchantLogin", mnag.EmailId, mnag.Password); merchantId = _bomerchantDetail.MerchantId; FillMerchantDetail(_bomerchantDetail); } else { Response.Redirect("Default.aspx", false); } } }
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); } }