Esempio n. 1
0
 public string SavePicup(SavePicupDetail Pick)
 {
     try
     {
         string constr = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
         using (SqlConnection conn = new SqlConnection(constr))
         {
             PickupMaster rm = new PickupMaster();
             rm.PickupID   = PickupMaster.GetMaxID() + 1;
             rm.FirstName  = Pick.FName;
             rm.LastName   = Pick.LName;
             rm.State      = Pick.State;
             rm.City       = Pick.City;
             rm.Address    = Pick.Address;
             rm.Pincode    = Pick.Pincode;
             rm.City       = Pick.City;
             rm.State      = Pick.State;
             rm.ContactNo  = Pick.ContactNo;
             rm.Alternate1 = Pick.Alternate1;
             rm.Alternate2 = Pick.Alternate2;
             rm.GstinNo    = Pick.GstinNo;
             rm.Regdate    = DateTime.Today;
             rm.Status     = "Waiting";
             rm.Action     = "Active";
             rm.Save();
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         return("Error..!! some technical issue");
     }
 }
 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");
        }