protected void btnUpdate_Click(object sender, EventArgs e) { #region PickupMaster um = new PickupMaster(); um.PickupID = int.Parse(Session["PickupID"].ToString()); um.FirstName = txtFname.Text.Trim(); um.LastName = txtLName.Text.Trim(); um.UserName = lblUsername.Text.Trim(); um.Password = PickupMaster.GetByPickupID(um.PickupID).Password; um.CenterName = lblCname.Text.Trim(); um.CenterCode = lblCCode.Text.Trim(); um.Address = txtadd.Text.Trim(); um.Pincode = txtPincode.Text; um.City = DropCity.SelectedIndex; um.State = DropState.SelectedIndex; um.ContactNo = txtContact.Text.Trim(); um.Alternate1 = txtAlternate1.Text.Trim(); um.Alternate2 = txtAlternate2.Text.Trim(); um.GstinNo = txtgst.Text.Trim(); um.Regdate = PickupMaster.GetByPickupID(um.PickupID).Regdate; um.Status = PickupMaster.GetByPickupID(um.PickupID).Status; um.Action = PickupMaster.GetByPickupID(um.PickupID).Action; um.PickUpWallet = PickupMaster.GetByPickupID(um.PickupID).PickUpWallet; um.Save(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Save Sucessfull...!!');</script>", false); Response.Redirect("frmProfileUpdate.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { List <PickupMaster> _pic = PickupMasterrCollection.GetAll().FindAll(x => x.UserName == txtuser.Text.Trim()); if (_pic.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('User Name Not Available...!!');</script>", false); txtuser.Focus(); return; } PickupMaster rm = new PickupMaster(); rm.PickupID = int.Parse(ViewState["MID"].ToString()); rm.FirstName = lblFname.Text.Trim(); rm.LastName = lblLName.Text.Trim(); rm.UserName = txtuser.Text.Trim(); rm.Password = txtPassword.Text; rm.CenterName = lblCname.Text.Trim(); rm.CenterCode = lblCCode.Text.Trim(); rm.Address = PickupMaster.GetByPickupID(rm.PickupID).Address; rm.Pincode = PickupMaster.GetByPickupID(rm.PickupID).Pincode; rm.City = PickupMaster.GetByPickupID(rm.PickupID).City; rm.State = PickupMaster.GetByPickupID(rm.PickupID).State; rm.ContactNo = lblContact.Text; rm.Alternate1 = PickupMaster.GetByPickupID(rm.PickupID).Alternate1; rm.Alternate2 = PickupMaster.GetByPickupID(rm.PickupID).Alternate2; rm.GstinNo = PickupMaster.GetByPickupID(rm.PickupID).GstinNo; rm.Regdate = PickupMaster.GetByPickupID(rm.PickupID).Regdate; rm.Status = "Approve"; rm.Action = "Active"; rm.Save(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Change Sucessfull...!!');</script>", false); Sendmsg("Your OMHRD PickUp User Name is " + " " + rm.UserName + " " + "And Password is" + rm.Password, rm.ContactNo.Trim()); Response.Redirect("PickUpWaitingList.aspx"); }
public void Member_detail(int MID) { try { PickupMaster drms = PickupMaster.GetByPickupID((int.Parse(Session["PickupID"].ToString()))); if (drms.PickupID > 0) { #region txtFname.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).FirstName; txtLName.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).LastName; lblUsername.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).UserName; lblCname.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).CenterName; lblCCode.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).CenterCode; txtadd.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).Address; txtPincode.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).Pincode; txtContact.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).ContactNo; txtAlternate1.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).Alternate1; txtAlternate2.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).Alternate2; txtgst.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).GstinNo; lblRegdate.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).Regdate.ToShortDateString(); lblstatus.Text = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).Status; DropState.SelectedIndex = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).State; fillcity(); DropCity.SelectedIndex = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).City; #endregion } } catch (Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } }
public void Member_detail(int MID) { try { PickupMaster drms = PickupMaster.GetByPickupID(MID); if (drms.PickupID > 0) { #region ViewState["StateCode"] = drms.State; ViewState["MID"] = MID; lblFname.Text = PickupMaster.GetByPickupID(drms.PickupID).FirstName; lblLName.Text = PickupMaster.GetByPickupID(drms.PickupID).LastName; txtuser.Text = drms.UserName; txtPassword.Text = drms.Password; #region CenterCode string Statecode = StateMaster.GetBySTATE_ID(int.Parse(ViewState["StateCode"].ToString())).STATECODE; string Date = System.DateTime.Today.ToString("yyMMdd"); CenterCode = Statecode + Date + "00" + ViewState["MID"]; #endregion lblCname.Text = "OMHRD" + CenterCode; lblCCode.Text = CenterCode; lblAdd.Text = drms.Address; lblId.Text = drms.GstinNo; lblContact.Text = PickupMaster.GetByPickupID(drms.PickupID).ContactNo; lblRegdate.Text = PickupMaster.GetByPickupID(drms.PickupID).Regdate.ToString("dd-MM-yyyy"); #endregion } } catch (Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblProfileName.Text = " Wellcome," + " " + PickupMaster.GetByPickupName(Session["Pickuser"] == null ? string.Empty : Session["Pickuser"].ToString()).FirstName + " " + PickupMaster.GetByPickupName(Session["Pickuser"] == null ? string.Empty : Session["Pickuser"].ToString()).LastName; decimal Am = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).PickUpWallet; lblWallet.Text = Am.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillstate(); Member_detail(int.Parse(Session["PickupID"].ToString())); decimal Am = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).PickUpWallet; lblWallet.Text = Am.ToString(); } }
public void Tranfer() { try { decimal totalamt = 0; int UserId = ddlUser.SelectedIndex; USERPROFILEMASTER User = USERPROFILEMASTER.GetByRegistration_ID(UserId); if (User.Registration_ID > 0) { foreach (GridViewRow gv in gdvNotice.Rows) { totalamt += decimal.Parse(gv.Cells[4].Text.ToString()); } decimal UserAmount = User.UserWallet; decimal TransferAmount = totalamt; if (UserAmount <= TransferAmount) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Insufulset amount in User account.!!!')</script>", false); return; } PickupMaster lm = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())); if (lm.PickupID > 0) { PickupMaster lmm = new PickupMaster(); decimal PreviousAmount = lm.PickUpWallet; decimal Amount = totalamt; decimal TotalAmount = PreviousAmount + Amount; lmm.PaymentByWallet(lm.PickupID, TotalAmount); { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Payment successful..!!!')</script>", false); } } decimal MyAmount = User.UserWallet; decimal TranferAmount = totalamt; decimal FinalAmount = MyAmount - TranferAmount; User.WalletRecharge(User.Registration_ID, FinalAmount); MakePayment(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Old Password is not Correct...!!!')</script>", false); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('" + ex.Message + "')</script>", false); } }
protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlItem.SelectedIndex > 0) { if (ddlUser.SelectedIndex > 0) { int ItemId = int.Parse(ddlItem.SelectedValue); int User = ddlUser.SelectedIndex; txtItemCode.Text = PickUpItemMaster.GetByOrderId(ItemId).HSNCODE; txtrate.Text = PickUpItemMaster.GetByOrderId(ItemId).RATE_PER.ToString(); int UserState = USERPROFILEMASTER.GetByRegistration_ID(User).State; int PicUpState = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString())).State; if (UserState == PicUpState) { txtigst.Text = "0"; txtcgst.Text = PickUpItemMaster.GetByOrderId(ItemId).CGST.ToString(); txtsgst.Text = PickUpItemMaster.GetByOrderId(ItemId).SGST.ToString(); } else { txtcgst.Text = "0"; txtsgst.Text = "0"; txtigst.Text = PickUpItemMaster.GetByOrderId(ItemId).IGST.ToString(); } } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<Script>alert('Plz Select User');</Script>", false); ddlUser.Focus(); return; } } else { txtcgst.Text = "0"; txtsgst.Text = "0"; txtigst.Text = "0"; } BindSizeColorDropdown(ddlItem.SelectedValue); } catch (Exception ew) { } }
protected void linkbtnApprove_Click(object sender, EventArgs e) { try { LinkButton lb = (LinkButton)sender; GridViewRow gv = (GridViewRow)lb.NamingContainer; int FileId = int.Parse(((Label)gv.FindControl("labelNOTICE_ID")).Text); PickupMaster rg = PickupMaster.GetByPickupID(FileId); if (rg.PickupID > 0) { Response.Redirect("frmEditPickupDetail.aspx?st=" + rg.PickupID); } } catch (Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } }
public void PrintBill() { try { int UserId = 0; Int32.TryParse(ddlUser.SelectedValue, out UserId); List <ProductInvoice_Master> _Pro = ProductInvoice_MasterCollection.GetAll().FindAll(x => x.BILL_ID == billid); #region Company string CompanyName = USERPROFILEMASTER.GetByUser_Name("OMHRD").First_Name; string CompanyAddress = USERPROFILEMASTER.GetByUser_Name("OMHRD").Address; string CompanyState = USERPROFILEMASTER.GetByUser_Name("OMHRD").StateName; string CompanyCity = USERPROFILEMASTER.GetByUser_Name("OMHRD").CityName; string ZipCode = USERPROFILEMASTER.GetByUser_Name("OMHRD").ZipCode; string CompanyGST = USERPROFILEMASTER.GetByUser_Name("OMHRD").GstinVerified; string CompanyContact = USERPROFILEMASTER.GetByUser_Name("OMHRD").ContactNumber; #endregion #region Seller string ShipName = USERPROFILEMASTER.GetByRegistration_ID(UserId).First_Name + " " + USERPROFILEMASTER.GetByRegistration_ID(UserId).Last_Name; string ShipAdd1 = USERPROFILEMASTER.GetByRegistration_ID(UserId).Address; string ShipAdd2 = USERPROFILEMASTER.GetByRegistration_ID(UserId).AddressLine2; string ShipState = USERPROFILEMASTER.GetByRegistration_ID(UserId).StateName; string ShipCity = USERPROFILEMASTER.GetByRegistration_ID(UserId).CityName; string ShipZip = USERPROFILEMASTER.GetByRegistration_ID(UserId).ZipCode; string Contry = USERPROFILEMASTER.GetByRegistration_ID(UserId).COUNTRY; string BillName = USERPROFILEMASTER.GetByRegistration_ID(UserId).First_Name + " " + USERPROFILEMASTER.GetByRegistration_ID(UserId).Last_Name; string PermanentAdd1 = USERPROFILEMASTER.GetByRegistration_ID(UserId).ShippingAddress; string PermanentAdd2 = USERPROFILEMASTER.GetByRegistration_ID(UserId).ShippingAddressLine2; string PermanentState = USERPROFILEMASTER.GetByRegistration_ID(UserId).ShippStateName; string PermanentCity = USERPROFILEMASTER.GetByRegistration_ID(UserId).ShipCityName; string PermanentZip = USERPROFILEMASTER.GetByRegistration_ID(UserId).ShippingZip; string Gstin = USERPROFILEMASTER.GetByRegistration_ID(UserId).GstinVerified; #endregion #region PickUp int PicupId = int.Parse(Session["PickupID"].ToString()); string PickUpName = PickupMaster.GetByPickupID(PicupId).FirstName + " " + PickupMaster.GetByPickupID(PicupId).LastName; string PickUpAddress = PickupMaster.GetByPickupID(PicupId).Address; string PickUpContact = PickupMaster.GetByPickupID(PicupId).ContactNo; string CenterName = PickupMaster.GetByPickupID(PicupId).CenterName; string CenterCode = PickupMaster.GetByPickupID(PicupId).CenterCode; #endregion #region BillDetail System.Guid guid = System.Guid.NewGuid(); String id = guid.ToString(); string OrderId = id; DateTime dt = System.DateTime.Today; string InvoiNo = ProductBill_Master.GetByBILL_ID(billid).BILLNO; string InvoiDate = dt.ToString(); string Phone = USERPROFILEMASTER.GetByRegistration_ID(UserId).ContactNumber; string Email = USERPROFILEMASTER.GetByRegistration_ID(UserId).Email; #endregion decimal totamt = Math.Round(ProductBill_Master.GetByBILL_ID(billid).TOTAL, 0); var values = totamt.ToString(CultureInfo.InvariantCulture).Split('.'); Int64 rup = Convert.ToInt64(values[0]); Int64 paise = 0; if (values.Length == 2) { paise = Convert.ToInt64(values[1]); } string rupee = string.Empty; string pa = string.Empty; if (paise != 0) { pa = Rupees(paise) + "Paise Only"; rupee = Rupees(rup) + "Rupees and " + pa; } else { rupee = Rupees(rup) + "Rupees Only"; } ReportViewer1.ProcessingMode = ProcessingMode.Local; this.ReportViewer1.LocalReport.EnableExternalImages = true; ReportViewer1.LocalReport.ReportPath = Server.MapPath("/Report/PickUpSale.rdlc"); ReportDataSource datasource = new ReportDataSource("BillGenrate", _Pro); ReportParameter[] rpt = new ReportParameter[33]; rpt[0] = new ReportParameter("CompanyName", CompanyName); rpt[1] = new ReportParameter("CompanyAddress", CompanyAddress); rpt[2] = new ReportParameter("CompanyState", CompanyState); rpt[3] = new ReportParameter("CompanyCity", CompanyCity); rpt[4] = new ReportParameter("ZipCode", ZipCode); rpt[5] = new ReportParameter("CompanyGST", CompanyGST); rpt[6] = new ReportParameter("CompanyContact", CompanyContact); rpt[7] = new ReportParameter("ShipName", ShipName); rpt[8] = new ReportParameter("ShipAdd1", ShipAdd1); rpt[9] = new ReportParameter("ShipAdd2", ShipAdd2); rpt[10] = new ReportParameter("ShipCity", ShipCity); rpt[11] = new ReportParameter("ShipState", ShipState); rpt[12] = new ReportParameter("ShipZip", ShipZip); rpt[13] = new ReportParameter("Contry", Contry); rpt[14] = new ReportParameter("BillName", BillName); rpt[15] = new ReportParameter("PermanentAdd1", PermanentAdd1); rpt[16] = new ReportParameter("PermanentAdd2", PermanentAdd2); rpt[17] = new ReportParameter("PermanentCity", PermanentCity); rpt[18] = new ReportParameter("PermanentState", PermanentState); rpt[19] = new ReportParameter("PermanentZip", PermanentZip); rpt[20] = new ReportParameter("Gstin", Gstin); rpt[21] = new ReportParameter("OrderId", OrderId); rpt[22] = new ReportParameter("InvoiNo", InvoiNo); rpt[23] = new ReportParameter("InvoiDate", InvoiDate); rpt[24] = new ReportParameter("Phone", Phone); rpt[25] = new ReportParameter("Email", Email); rpt[26] = new ReportParameter("TotalAmountWord", rupee); rpt[27] = new ReportParameter("PaymentMod", PaymentMod); rpt[28] = new ReportParameter("PickUpName", PickUpName); rpt[29] = new ReportParameter("PickUpAddress", PickUpAddress); rpt[30] = new ReportParameter("PickUpContact", PickUpContact); rpt[31] = new ReportParameter("CenterName", CenterName); rpt[32] = new ReportParameter("CenterCode", CenterCode); this.ReportViewer1.LocalReport.SetParameters(rpt); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.DataSources.Add(datasource); this.ReportViewer1.LocalReport.Refresh(); } catch (Exception ex) { } }