示例#1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        sms s = new sms(); int z = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox c = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            Label m = (Label)GridView1.Rows[i].FindControl("Label2");


            if (c.Checked == true)
            {
                s.SendSMS(m.Text, TextBox1.Text);
                z = 1;
            }
        }

        if (z == 1)
        {
            TextBox1.Text = "";
            msg.Show("SMS sent successfully");
        }
        else
        {
            msg.Show("Select users");
        }
    }
示例#2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        MessageBox msg = new MessageBox();

        admin          ad = new admin();
        MembershipUser u  = Membership.GetUser(TextBox1.Text);

        if (u == null)
        {
            msg.Show("Invalid username");
        }
        else
        {
            Guid a = new Guid(u.ProviderUserKey.ToString());


            DataSet ds = ad.getuserpassword(a);

            string pass  = ds.Tables[0].Rows[0]["password"].ToString();
            string email = u.Email.ToString();

            ProfileCommon comm     = Profile.GetProfile(TextBox1.Text);
            string        username = TextBox1.Text;
            string        mobile   = comm.Mobile;
            string        name     = comm.FirstName;
            mailing       mail     = new mailing();
            string        mess1    = "Dear " + name + ",<br><br>Your freshprawnsonline account password is:" + pass + "<br><br>Regards,<br>Admin, Farm Fresh Prawns.";
            string        mess     = "Dear " + name + " Your freshprawnsonline account password is:" + pass;
            mail.mymail(email, mess1, "Password Retrieval");
            sms s = new sms();
            s.SendSMS(mobile, mess);
            TextBox1.Text = "";
            msg.Show("Password has been sent to your provided email and mobile number");
        }
    }
示例#3
0
    protected void sndmsg_Click(object sender, EventArgs e)
    {
        string mobnoms = "";

        foreach (GridViewRow gvro in GridView1.Rows)
        {
            if (gvro.RowType == DataControlRowType.DataRow)
            {
                //TextBox txt =(TextBox)gvro.FindControl("txt");
                CheckBox cko = new CheckBox();
                cko = (CheckBox)gvro.FindControl("cchk");
                if (cko.Checked == true)
                {
                    mobnoms += gvro.Cells[2].Text + ",";
                    //mobnoms += txt.Text + ",";
                }
            }
        }
        // Send sms
        if (mobnoms.Length > 0)
        {
            mobnoms = mobnoms.Substring(0, mobnoms.Length - 1);// Remove last ,

            sms Snd = new sms();
            Snd.SendSMS(mobnoms, TxtMessage.Text);
            lblSuccess.Text = "Message has been sent successfully";
            // lblmessage.Visible = true;
        }
    }
示例#4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        sms s = new sms();

        s.SendSMS(Label6.Text, TextBox1.Text);
        MessageBox msg = new MessageBox();

        TextBox1.Text = "";
        msg.Show("SMS sent successfully");
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string   s     = Request.Form["responseparams"];
            string[] param = s.Split('|');
            Label2.Text = param[0].ToString();
            Label3.Text = param[5].ToString();
            Label4.Text = param[6].ToString();



            MembershipUser memb   = Membership.GetUser(Profile.UserName);
            string         userid = "";
            try
            {
                userid = memb.ProviderUserKey.ToString();
            }
            catch (Exception ex)
            {
                Response.Redirect("Login.aspx");
            }

            DataSet ds      = or.select_order(userid);
            string  name    = ds.Tables[0].Rows[0]["firstname"].ToString();
            string  address = ds.Tables[0].Rows[0]["address"].ToString();
            string  city    = ds.Tables[0].Rows[0]["city"].ToString();
            string  state   = ds.Tables[0].Rows[0]["state"].ToString();

            string email  = ds.Tables[0].Rows[0]["email"].ToString();
            string mobile = ds.Tables[0].Rows[0]["mobile"].ToString();

            string ship_name    = ds.Tables[0].Rows[0]["delivery_firstname"].ToString();
            string ship_address = ds.Tables[0].Rows[0]["delivery_address"].ToString();
            string ship_city    = ds.Tables[0].Rows[0]["delivery_city"].ToString();
            string ship_state   = ds.Tables[0].Rows[0]["delivery_state"].ToString();

            string ship_email  = ds.Tables[0].Rows[0]["delivery_email"].ToString();
            string ship_mobile = ds.Tables[0].Rows[0]["delivery_mobile"].ToString();


            //email to delivery address
            string msg = "Dear " + ship_name + ", An order for prawn from " + name + " account of amount Rs." + Label4.Text + " has been marked as unsuccessfull. Order id is " + Label3.Text + " and direcpay reference id " + Label2.Text;



            em.mymail(ship_email, msg, "Order Unsuccessfull");
            string msg1 = "Dear " + name + ", " + "An order made for " + ship_name + " from your farmfreshprawns account of amount  Rs." + Label4.Text + " has been marked as unsuccessfull. Order id is " + Label3.Text + " and direcpay reference id " + Label2.Text;

            //email to billing address
            em.mymail(email, msg1, "Order Unsuccessfull");

            sms sm = new sms();

            sm.SendSMS(mobile, msg1);

            string adminmobile = sms.adminsms;
            string adminemail  = sms.adminemail;

            string adminmessage = "Dear Admin, New order placed from " + name + "for amount of  Rs." + Label4.Text + ". has been marked as unsuccessfull. Order id is " + Label3.Text + " and DirecPay reference id is " + Label2.Text;
            em.mymail(adminemail, adminmessage, "Order Unsuccessfull");
            sm.SendSMS(adminmobile, adminmessage);
            Profile.prawncrunchShopping.Items.Clear();
        }
    }
示例#6
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string    id = Request.QueryString["orders_id"].ToString();
        DataTable dt = ro.select_order_prod_by_order_id(id);

        string comment = txtcomment.Text;
        string status  = ddlstatus.SelectedItem.Text.ToString();

        //updating status in orders table
        int i = Convert.ToInt32(id);

        ro.updateorderstatus(i, status);

        //updating status in order summary table

        DataTable dt1    = ro.fillorderbyid(i);
        string    tempid = dt1.Rows[0]["id"].ToString();
        string    cdate  = dt1.Rows[0]["date"].ToString();
        string    email  = dt1.Rows[0]["email"].ToString();
        string    mobile = dt1.Rows[0]["mobile"].ToString();

        string mobtemp = "Dear Customer your prawns order bearning no:" + tempid + " is in " + status + " status";

        s.SendSMS(mobile, mobtemp);


        //notify value
        if (CheckBox_notify.Checked == true)
        {
            ro.updateordersummary(i, cdate, status, comment);
            fillorderstatusgrid();
            txtcomment.Text = "";

            //append comment to mail
            if (Check_comment.Checked == true)
            {
                try
                {
                    string mto   = email;
                    string mFrom = "*****@*****.**";

                    if (mto != "" && mFrom != "")
                    {
                        MailMessage message = new MailMessage();
                        message.From = new MailAddress(mFrom);
                        message.To.Add(mto);
                        message.IsBodyHtml = true;


                        string temp = "Dear Customer your prawn crunch order bearning no:" + tempid + " is in " + status + " status" + "<br>" + "Comments are as follows :" + comment;
                        message.Body    = temp;
                        message.Subject = "Order Status";

                        SmtpClient smtp = new SmtpClient("localhost", 25);

                        smtp.Send(message);
                        message.Dispose();

                        MessageBox msg1 = new MessageBox();
                        msg1.Show("Mail has been sent successfully");
                    }

                    else
                    {
                        MessageBox msg2 = new MessageBox();
                        msg2.Show("Send feed back again after some time");
                    }
                }

                catch (Exception ex)
                {
                    MessageBox msg3 = new MessageBox();
                    msg3.Show(ex.ToString());
                }
            }


//dont append comment to mail

            else
            {
                try
                {
                    string mto   = email;
                    string mFrom = "*****@*****.**";

                    if (mto != "" && mFrom != "")
                    {
                        MailMessage message = new MailMessage();
                        message.From = new MailAddress(mFrom);
                        message.To.Add(mto);
                        message.IsBodyHtml = true;


                        string temp = "Dear Customer your prawn crunch order bearning no:" + tempid + " is in " + status + " status";
                        message.Body    = temp;
                        message.Subject = "Order Status";

                        SmtpClient smtp = new SmtpClient("localhost", 25);

                        smtp.Send(message);
                        message.Dispose();

                        MessageBox msg1 = new MessageBox();
                        msg1.Show("Mail has been sent successfully");
                    }

                    else
                    {
                        MessageBox msg2 = new MessageBox();
                        msg2.Show("Send feed back again after some time");
                    }
                }

                catch (Exception ex)
                {
                    MessageBox msg3 = new MessageBox();
                    msg3.Show(ex.ToString());
                }
            }
        }
        else
        {
            ro.updateordersummary(i, cdate, status, comment);
            fillorderstatusgrid();
            txtcomment.Text = "";
            msg.Show("Order Summary updated successfully");
        }
        fillorderstatusgrid();
    }
示例#7
0
    public string GetErrorMessage(MembershipCreateStatus status)
    {
        switch (status)
        {
        case MembershipCreateStatus.DuplicateUserName:
            return("Username already exists. Please enter a different user name.");

        case MembershipCreateStatus.DuplicateEmail:
            return("A username for that e-mail address already exists. Please enter a different e-mail address.");

        case MembershipCreateStatus.InvalidPassword:
            return("Password should be of minimum of 6 characters and should be alphanumeric");

        case MembershipCreateStatus.InvalidEmail:
            return("The e-mail address provided is invalid. Please check the value and try again.");

        case MembershipCreateStatus.InvalidAnswer:
            return("The password retrieval answer provided is invalid. Please check the value and try again.");

        case MembershipCreateStatus.InvalidQuestion:
            return("The password retrieval question provided is invalid. Please check the value and try again.");

        case MembershipCreateStatus.InvalidUserName:
            return("The user name provided is invalid. Please check the value and try again.");

        case MembershipCreateStatus.ProviderError:
            return("The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.");

        case MembershipCreateStatus.UserRejected:
            return("The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.");

        case MembershipCreateStatus.Success:

            ProfileCommon pc = (ProfileCommon)ProfileCommon.Create(Username.Text, true);
            Roles.AddUserToRole(Username.Text, "user");



            pc.FirstName = firstname.Text;

            pc.Phone   = phone.Text;
            pc.Mobile  = mobile.Text;
            pc.Address = address1.Text;

            pc.City = DropDownList1.SelectedItem.Text;


            pc.State = Region.Text;



            pc.Save();



            mailing mail = new mailing();
            string  msg1 = "Congratulations you are registered successfully with Fresh Farm Prawns" + "<br>" + "Username: "******"<br>" + "Password: "******"<br>" + "Regards ," + "<br>" + "Admin" + ", " + "Fresh Farm Prawns";
            mail.mymail(Email.Text, msg1, "User Registration");
            sms s = new sms();
            s.SendSMS(mobile.Text, "Dear " + firstname.Text + " your freshprawnsonline account has been created. Username:"******" Password:"******"";
            //Password.Text = "";
            //Repassword.Text = "";

            //firstname.Text = "";

            //address1.Text = "";
            //DropDownList1.SelectedIndex = 0;


            //Region.Text = "";
            //Email.Text = "";
            //mobile.Text = "";
            //phone.Text = "";
            //CheckBox2.Checked = false;



            // address1.Text = city.Text = answer.Text = Region.Text = Email.Text = firstname.Text = lastname.Text = phone.Text = mobile.Text = Username.Text = "";

            return("Registered Successfully");



        default:
            return("An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.");
        }
    }