示例#1
0
    protected void reg_Click(object sender, EventArgs e)
    {
        string a = " ";
        string c = DropDownList1.Text;

        if (f.Checked == true)
        {
            a = f.Text;
        }
        else
        {
            a = m.Text;
        }

        string s = "insert into farmer values('" + f_id.Text + "','" + f_name.Text + "','" + a + "','" + hm_name.Text + "','" + plac_e.Text + "','" + c + "','" + cnt_no.Text + "','" + email_id.Text + "')";

        db.nonreturn(s);
        string s1 = "insert into login values('" + f_id.Text + "','" + email_id.Text + "','" + pas_word.Text + "','Farmer')";

        db.nonreturn(s1);
        Response.Write("<script>alert('Inserted successfully...')</script>");
        f_name.Text   = " ";
        hm_name.Text  = " ";
        plac_e.Text   = " ";
        cnt_no.Text   = " ";
        email_id.Text = " ";
        pas_word.Text = " ";
        cur_word.Text = " ";
    }
示例#2
0
 protected void save_Click(object sender, EventArgs e)
 {
     if (save.Text == "SAVE")
     {
         string s = "insert into krishibhavan values ('" + k_id.Text + "','" + pl_c.Text + "','" + pan_ch.Text + "','" + dis_t.Text + "','" + Pin.Text + "','" + cnt_nm.Text + "')";
         db.nonreturn(s);
         Response.Write("<script>alert('Inserted successfully...');window.location='adminkrishibhavan.aspx'</script>");
         pl_c.Text   = " ";
         pan_ch.Text = " ";
         dis_t.Text  = " ";
         Pin.Text    = " ";
         cnt_nm.Text = " ";
     }
     else
     {
         string a = "update krishibhavan set placename='" + pl_c.Text + "', panchayath='" + pan_ch.Text + "',District='" + dis_t.Text + "',PIN='" + Pin.Text + "',phoneno='" + cnt_nm.Text + "' where KID='" + k_id.Text + "'";
         db.nonreturn(a);
         Response.Write("<script>alert('updated successfully...');window.location='adminkrishibhavan.aspx'</script>");
         pl_c.Text   = " ";
         pan_ch.Text = " ";
         dis_t.Text  = " ";
         Pin.Text    = " ";
         cnt_nm.Text = " ";
     }
 }
示例#3
0
    protected void save_Click(object sender, EventArgs e)
    {
        string b = "select max(artid) from article";
        string c = db.maxid(b).ToString();
        string s = "insert into article values ('" + c + "','" + System.DateTime.Now.ToShortDateString() + "','" + artit.Text + "','" + Session["path"] + "')";

        db.nonreturn(s);
        Response.Write("<script>alert('Inserted successfully...');window.location='adminarticle.aspx'</script>");
        artit.Text = " ";
        MultiView1.SetActiveView(View1);
        grid();
    }
示例#4
0
    protected void save_Click(object sender, EventArgs e)
    {
        Random rnd = new Random();
        int    pwd = rnd.Next(4411, 55555);
        string a   = "select max(userid) from login";

        b = db.maxid(a).ToString();
        z = "AO" + b;
        string dob = DropDownList2.Text + "/" + DropDownList3.Text + "/" + DropDownList4.Text;
        string doj = DropDownList5.Text + "/" + DropDownList6.Text + "/" + DropDownList7.Text;
        string dor = DropDownList8.Text + "/" + DropDownList9.Text + "/" + DropDownList10.Text;
        string g   = " ";

        if (f.Checked == true)
        {
            g = f.Text;
        }
        else
        {
            g = m.Text;
        }
        if (save.Text == "save")
        {
            string s = "insert into AOS values('" + b + "'," + DropDownList1.SelectedValue + ",'" + name.Text + "','" + em_l.Text + "','" + Ph_ne.Text + "','" + doj + "','" + dob + "','" + dor + "','" + z + "','" + Session["path"] + "','" + g + "')";
            db.nonreturn(s);
            string u = "insert into login values('" + b + "','" + z + "','" + pwd + "','AO')";
            db.nonreturn(u);
            SmtpClient  sc  = new SmtpClient("smtp.gmail.com", 587);
            MailMessage msg = new MailMessage("*****@*****.**", em_l.Text);
            msg.Subject    = "Your A/C password";
            msg.Body       = ("thankyou for registering. Your username is" + z + "Your password is" + pwd);
            sc.Credentials = new NetworkCredential("anjithad43", " muqmapassion");
            sc.EnableSsl   = true;
            sc.Send(msg);
            Response.Write("<script>alert('Inserted successfully...');window.location='adminaoreg.aspx'</script>");
            name.Text  = " ";
            em_l.Text  = " ";
            Ph_ne.Text = " ";
        }
        else
        {
            string c = "update AOS set name=" + name.Text + ", emailid= " + em_l.Text + ",phoneid='" + Ph_ne.Text + "' where aid='" + b + "'";
            db.nonreturn(c);
            Response.Write("<script>alert('updated successfully...');window.location='adminaoreg.aspx'</script>");
            name.Text  = " ";
            em_l.Text  = " ";
            Ph_ne.Text = " ";
        }
    }
示例#5
0
    protected void save_Click(object sender, EventArgs e)
    {
        string b = "insert into culturingmethod values('" + DropDownList1.SelectedValue + "','" + Session["path"] + "','" + weathr_details.Text + "')";

        db.nonreturn(b);
        Response.Write("<script>alert('Inserted successfully...');window.location='agricultureingmethod.aspx'</script>");
    }
示例#6
0
    public string registerfarmer(string name, string gender, string house, string place, string district, string contactno, string email)
    {
        string res = "";

        try
        {
            string a = "select maxid(userid) from login";
            string s = "insert into farmer values(" + a + ",'" + name + "','" + gender + "','" + house + "','" + place + "','" + district + "','" + contactno + "','" + email + "')";
            op.nonreturn(s);
            res = "yes";
        }
        catch
        {
            res = "no";
        }
        return(res);
    }
    protected void send_Click(object sender, EventArgs e)
    {
        string c = "select max(replyid) from reply";
        string d = db.maxid(c).ToString();
        string b = "insert into reply values ('" + Session["msgid"] + "','" + d + "','" + msgs + "')";

        db.nonreturn(b);
        Response.Write("<script>alert('Reply send successfully...');window.location='agridoubtclearence.aspx'</script>");
    }
 protected void save_Click(object sender, EventArgs e)
 {
     if (save.Text == "SAVE")
     {
         string s = "insert into governmentpolicies values('" + policy_no.Text + "','" + sub.Text + "','" + des.Text + "','" + dte.Text + "')";
         db.nonreturn(s);
         Response.Write("<script>alert('Inserted successfully...');window.location='admingovernpolicy.aspx'</script>");
         sub.Text = " ";
         des.Text = " ";
         dte.Text = " ";
     }
     else
     {
         string g = "update governmentpolicies set subject='" + sub.Text + "',description='" + des.Text + "',date='" + dte.Text + "' where policyno='" + policy_no.Text + "'";
         db.nonreturn(g);
         Response.Write("<script>alert('updated successfully...');window.location='admingovernpolicy.aspx'</script>");
         sub.Text = " ";
         des.Text = " ";
         dte.Text = " ";
     }
 }
    protected void save1_Click(object sender, EventArgs e)
    {
        string a = "select max(cropid) from cropdetails";
        string b = db.maxid(a).ToString();

        if (save1.Text == "SAVE")
        {
            string s = "insert into cropdetails values('" + b + "','" + crty.Text + "','" + crc.Text + "','" + crn.Text + "','" + Session["path"] + "','" + dt.Text + "')";
            db.nonreturn(s);
            Response.Write("<script>alert('Inserted successfully...');window.location='agricropferti.aspx'</script>");
            crty.Text = " ";
            crc.Text  = " ";
            crn.Text  = " ";
            dt.Text   = " ";
            grid1();
        }
        else
        {
            string s = "update cropdetails set croptype='" + crty.Text + "',cropclass='" + crc.Text + "',cropname='" + crn.Text + "',details='" + dt.Text + "' where cropid='" + b + "'";
            db.nonreturn(s);
            Response.Write("<script>alert('updated successfully...');window.location='agricropferti.aspx'</script>");
            crty.Text = " ";
            crc.Text  = " ";
            dt.Text   = " ";
            grid1();
        }
    }
示例#10
0
    protected void save_Click(object sender, EventArgs e)
    {
        string a = "select max(fertid) from fertilizerdetails";
        string b = db.maxid(a).ToString();

        if (save.Text == "SAVE")
        {
            string s = "insert into fertilizerdetails values ('" + b + "','" + fertn.Text + "','" + usedfr.Text + "','" + Session["path"] + "')";
            db.nonreturn(s);
            Response.Write("<script>alert('Inserted successfully...');window.location='adminferti.aspx'</script>");
            fertn.Text  = " ";
            usedfr.Text = " ";
        }
        else
        {
            string s = "update fertilizerdetails set fertname='" + fertn.Text + "',usedin='" + usedfr.Text + "' where fertid='" + b + "'";
            db.nonreturn(s);
            Response.Write("<script>alert('Updated successfully...');window.location='adminferti.aspx'</script>");
            fertn.Text  = " ";
            usedfr.Text = " ";
        }
    }
示例#11
0
    protected void save_Click(object sender, EventArgs e)
    {
        string b = "select max(policyid) from notification";
        string c = db.maxid(b).ToString();

        if (save.Text == "SAVE")
        {
            string s = "insert into notification values ('" + c + "','" + tit.Text + "','" + notd.Text + "','" + notde.Text + "')";
            db.nonreturn(s);
            Response.Write("<script>alert('Inserted successfully...');window.location='adminnotification.aspx'</script>");
            tit.Text   = " ";
            notd.Text  = " ";
            notde.Text = " ";
        }
        else
        {
            string s = "update notification set title='" + tit.Text + "',notdate='" + notd.Text + "',notdet='" + notde.Text + "' where policyid='" + c + "'";
            db.nonreturn(s);
            Response.Write("<script>alert('updated successfully...');window.location='adminnotification.aspx'</script>");
            tit.Text   = " ";
            notde.Text = " ";
            notd.Text  = " ";
        }
    }