Esempio n. 1
0
        public override void btnsave_Click(object sender, EventArgs e)
        {
            int i = 0;

            if (add_edit == true)
            {
                c.returnconn(c.myconn);
                SqlTransaction trn = c.myconn.BeginTransaction();
                do
                {
                    c.connectsql("insert into tbl_schamount (Classcode,Category,sessioncode,Amount) values ('" + cmbclass.SelectedValue + "','" + dtgfeeheads.Rows[i].Cells["Category"].Value + "','" + school.CurrentSessionCode + "','" + Convert.ToDecimal(dtgfeeheads.Rows[i].Cells["Amount"].Value) + "')", c.myconn, trn);
                    i++;
                }while (i < dtgfeeheads.Rows.Count);
                trn.Commit();
                MessageBox.Show("Data Saved..", "School");
                add_edit = false;
                c.GetMdiParent(this).EnableAllEditMenuButtons();
            }
            else
            {
                if (add_edit == false)
                {
                    SqlTransaction trn = c.myconn.BeginTransaction();
                    c.connectsql("delete from tbl_schamount where sessioncode='" + school.CurrentSessionCode + "' and  Classcode='" + cmbclass.SelectedValue + "'", c.myconn, trn);
                    do
                    {
                        c.connectsql("insert into tbl_schamount (Classcode,Category,sessioncode,Amount) values ('" + cmbclass.SelectedValue + "','" + dtgfeeheads.Rows[i].Cells["Category"].Value + "','" + school.CurrentSessionCode + "','" + Convert.ToDecimal(dtgfeeheads.Rows[i].Cells["Amount"].Value) + "')", c.myconn, trn);
                        i++;
                    }while (i < dtgfeeheads.Rows.Count);
                    trn.Commit();
                    MessageBox.Show("Data Saved..", "School");
                    add_edit = false;
                    c.GetMdiParent(this).EnableAllEditMenuButtons();
                }
                DesignForm.fromDesign1(this);
            }
        }
Esempio n. 2
0
 public ShowAllReports()
 {
     InitializeComponent();    DesignForm.fromDesign1(this);
 }
Esempio n. 3
0
 public frmtehsil()
 {
     InitializeComponent();    DesignForm.fromDesign1(this);
 }
Esempio n. 4
0
        public void btnsave_Click(object sender, EventArgs e)
        {
            if (valcmbbank.Text == "" && valcmbaccountgroup.Text == "" && txtPaidAmt.Text == "" && txtNarration.Text == "")
            {
                MessageBox.Show("Null Value Not Allowed ");
            }
            else
            {
                int Bank1;
                int Bank2;
                Bank1 = Convert.ToInt32(valcmbaccountgroup.SelectedValue);
                Bank2 = Convert.ToInt32(valcmbbank.SelectedValue);
                if (Bank1 == Bank2)
                {
                    MessageBox.Show("Both Accounts are same....");
                    goto mline;
                }
                c.returnconn(c.myconn);
                txtvchtype.Text = "BP";
                if (add_edit == true)
                {
                    SqlConnection con   = c.myconn;
                    DateTime      dt    = dtp.Value;
                    Int32         VchNo = c.getvchno(txtvchtype.Text, ref dt, con);
                    vouchNo           = c.getvouchernumber(txtvchtype.Text, ref dt, con); //txtvchtype.Text +  dtp.Value.Date.ToString("ddMMyyyy") + VchNo;
                    txtvoucherno.Text = vouchNo;
                    SqlTransaction trn;
                    trn = c.myconn.BeginTransaction();
                    try
                    {
                        string mysql;
                        mysql = "insert into tbl_Voucher(YearNo,VchNo,VouchNo,VchType,VchDate,Remark,Status)values('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dtp.Value.Date + "','" + txtNarration.Text + "','AE')";
                        c.connectsql(mysql, c.myconn, trn);
                        mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,CashBankNo,ChequeNo,ChequeDate) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + valcmbbank.SelectedValue + "','" + dtp.Value.Date + "'," + -1 * Convert.ToDecimal(txtPaidAmt.Text) + ",0,'" + txtChkNo.Text + "','" + txtChkDate.Value + "')";
                        c.connectsql(mysql, c.myconn, trn);
                        mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,CashBankNo,ChequeNo,ChequeDate) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + valcmbaccountgroup.SelectedValue + "','" + dtp.Value.Date + "','" + txtPaidAmt.Text + "','" + valcmbbank.SelectedValue + "','" + txtChkNo.Text + "','" + txtChkDate.Value + "')";
                        c.connectsql(mysql, c.myconn, trn);
                        trn.Commit();
                        MessageBox.Show("Record Saved...");
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        trn.Rollback();
                    }
                    trn.Dispose();
                }
                if (add_edit == false)
                {
                    c.getconnstr();
                    c.returnconn(c.myconn);
                    SqlDataReader dr = null;
                    con = c.myconn;
                    dr  = c.fillreader(ref dr, "select VchNo,Status from tbl_Voucher where vchtype='BP'  and VouchNo='" + txtvoucherno.Text + "'", con);
                    if (dr.HasRows == true)
                    {
                        dr.Read();
                        VchNo = Convert.ToInt16(dr[0]);
                        if (dr[1] == "AE")
                        {
                            MessageBox.Show("Voucher Not Made from Account Entry...");
                            dr.Close();
                            goto mline;
                        }
                    }
                    dr.Close();
                    c.returnconn(c.myconn);
                    SqlTransaction trn;
                    trn = c.myconn.BeginTransaction();
                    try
                    {
                        string mysql;
                        mysql = "delete from tbl_Voucher where vchtype='BP'  and VouchNo='" + txtvoucherno.Text + "'";
                        c.connectsql(mysql, c.myconn, trn);
                        mysql = "delete from tbl_VoucherDetail where  vchtype='BP' and VouchNo='" + txtvoucherno.Text + "'";
                        c.connectsql(mysql, c.myconn, trn);
                        mysql = "insert into tbl_Voucher(YearNo,VchNo,VouchNo,VchType,VchDate,Remark,Status)values('" + school.CurrentSessionCode + "','" + VchNo + "','" + txtvoucherno.Text + "','" + txtvchtype.Text + "','" + dtp.Value.Date + "','" + txtNarration.Text + "','AE')";
                        c.connectsql(mysql, c.myconn, trn);
                        mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,CashBankNo,ChequeNo,ChequeDate) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + valcmbbank.SelectedValue + "','" + dtp.Value.Date + "'," + -1 * Convert.ToDecimal(txtPaidAmt.Text) + ",0,'" + txtChkNo.Text + "','" + txtChkDate.Value + "')";
                        c.connectsql(mysql, c.myconn, trn);
                        mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,CashBankNo,ChequeNo,ChequeDate) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + valcmbaccountgroup.SelectedValue + "','" + dtp.Value.Date + "','" + txtPaidAmt.Text + "','" + valcmbbank.SelectedValue + "','" + txtChkNo.Text + "','" + txtChkDate.Value + "')";
                        c.connectsql(mysql, c.myconn, trn);
                        trn.Commit();
                        MessageBox.Show("Record Update...");
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        trn.Rollback();
                    }
                    trn.Dispose();
                }
mline:
                c.GetMdiParent(this).EnableAllEditMenuButtons();

                DesignForm.fromDesign1(this);
            }
        }
Esempio n. 5
0
        public void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                int ricept;
                int Payment;
                ricept  = Convert.ToInt32(txtReciept.Text);
                Payment = Convert.ToInt32(txtPayment.Text);
                if (ricept != Payment)
                {
                    MessageBox.Show("Payment Amount and Reciept Amount Does not Match...Entry Cannot Saved..");
                }
                else
                {
                    c.getconnstr();
                    c.returnconn(c.myconn);
                    txtvchtype.Text = "JV";
                    if (add_edit == true)
                    {
                        SqlConnection con   = c.myconn;
                        DateTime      dt    = dtp.Value;
                        Int32         VchNo = c.getvchno(txtvchtype.Text, ref dt, con);
                        vouchNo           = c.getvouchernumber(txtvchtype.Text, ref dt, con); //txtvchtype.Text +  dtp.Value.Date.ToString("ddMMyyyy") + VchNo;
                        txtvoucherno.Text = vouchNo;
                        SqlTransaction trn;
                        trn = c.myconn.BeginTransaction();
                        try
                        {
                            string mysql;
                            mysql = "insert into tbl_Voucher(yearno,VchNo,VouchNo,VchType,VchDate,Remark,status)values('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dtp.Value.Date + "','" + txtRemark.Text + "','AE')";
                            c.connectsql(mysql, c.myconn, trn);
                            for (int i = 0; i < dataGridView1.Rows.Count; i++)
                            {
                                decimal pay = Convert.ToInt32(dataGridView1.Rows[i].Cells["Payment"].Value);
                                decimal rec = Convert.ToInt32(dataGridView1.Rows[i].Cells["Reciept"].Value);
                                if (pay == 0)
                                {
                                    mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "','" + rec + "')";
                                }
                                else
                                {
                                    mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "','" + -1 * pay + "')";
                                }
                                c.connectsql(mysql, c.myconn, trn);
                            }
                            trn.Commit();
                            MessageBox.Show("Record Saved...");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                            trn.Rollback();
                        }
                    }
                    if (add_edit == false)
                    {
                        c.getconnstr();
                        c.returnconn(c.myconn);
                        SqlDataReader dr = null;
                        con = c.myconn;
                        dr  = c.fillreader(ref dr, "select VchNo from tbl_Voucher where vchtype='JV'  and VouchNo='" + txtvoucherno.Text + "'", con);
                        if (dr.HasRows == true)
                        {
                            dr.Read();
                            VchNo = Convert.ToInt16(dr[0]);
                            if (dr[1] == "AE")
                            {
                                MessageBox.Show("Voucher Not Made from Account Entry...");
                                dr.Close();
                                goto mline;
                            }
                        }
                        dr.Close();
                        SqlTransaction trn;
                        trn = c.myconn.BeginTransaction();
                        try
                        {
                            string mysql;
                            mysql = "delete from tbl_Voucher where vchtype='JV'  and VouchNo='" + txtvoucherno.Text + "'";
                            c.connectsql(mysql, c.myconn, trn);
                            mysql = "delete from tbl_VoucherDetail where  vchtype='JV' and VouchNo='" + txtvoucherno.Text + "'";
                            c.connectsql(mysql, c.myconn, trn);
                            for (int i = 0; i < dataGridView1.Rows.Count; i++)
                            {
                                decimal pay = Convert.ToInt32(dataGridView1.Rows[i].Cells["Payment"].Value);
                                decimal rec = Convert.ToInt32(dataGridView1.Rows[i].Cells["Reciept"].Value);
                                if (pay == 0)
                                {
                                    mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "'," + rec + "')";
                                }
                                else
                                {
                                    mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "'," + -1 * pay + "')";
                                }
                                c.connectsql(mysql, c.myconn, trn);
                            }
                            trn.Commit();
                            MessageBox.Show("Record Update...");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                            trn.Rollback();
                        }
                        trn.Dispose();
                    }
mline:
                    c.GetMdiParent(this).EnableAllEditMenuButtons();

                    DesignForm.fromDesign1(this);
                }
            }

            catch { }
        }
Esempio n. 6
0
 public frmScholarshipclassfee()
 {
     InitializeComponent(); Connection.SetUserControlTheme(this); DesignForm.fromDesign1(this);
 }
Esempio n. 7
0
 public framfeesetup()
 {
     InitializeComponent();    DesignForm.fromDesign1(this);
     Connection.SetUserControlTheme(this);
 }
Esempio n. 8
0
        public void btnsave_Click(object sender, EventArgs e)
        {
            int           BHM_DES  = 0;
            SqlCommand    command1 = new SqlCommand("select BHM_COD from tbl_LedgerAcc where BHM_COD=1", c.myconn);
            SqlDataReader reader1  = command1.ExecuteReader();
            int           i        = 0;

            if (reader1.HasRows)
            {
                reader1.Read();
                BHM_DES = Convert.ToInt16(reader1["BHM_COD"]);
                if (BHM_DES != 1)
                {
                    MessageBox.Show("Cannot Select Cash Account..");
                    reader1.Close();
                    goto mline;
                }
            }
            c.returnconn(c.myconn);
            txtvchtype.Text = "CR";
            if (add_edit == true)
            {
                SqlConnection con   = c.myconn;
                DateTime      dt    = dtp.Value;
                Int32         VchNo = c.getvchno(txtvchtype.Text, ref dt, con);
                vouchNo           = c.getvouchernumber(txtvchtype.Text, ref dt, con); //txtvchtype.Text +  dtp.Value.Date.ToString("ddMMyyyy") + VchNo;
                txtvoucherno.Text = vouchNo;
                SqlTransaction trn;
                trn = c.myconn.BeginTransaction();
                try
                {
                    string mysql;
                    mysql = "insert into tbl_Voucher(YearNo,VchNo,VouchNo,VchType,VchDate,Remark)values('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dtp.Value.Date + "','" + txtRemark.Text + "')";
                    c.connectsql(mysql, c.myconn, trn);
                    mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,cashbankno) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + BHM_DES + "','" + dtp.Value.Date + "'," + txtReceiptAmt.Text + ",0)";
                    c.connectsql(mysql, c.myconn, trn);
                    mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,cashbankno) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + valcmbaccountgroup.SelectedValue + "','" + dtp.Value.Date + "'," + -1 * Convert.ToDecimal(txtReceiptAmt.Text) + ",'" + BHM_DES + "')";
                    c.connectsql(mysql, c.myconn, trn);
                    trn.Commit();
                    MessageBox.Show("Record Saved...");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    trn.Rollback();
                }
                trn.Dispose();
            }
            if (add_edit == false)
            {
                c.getconnstr();
                c.returnconn(c.myconn);
                SqlDataReader dr = null;
                con = c.myconn;
                dr  = c.fillreader(ref dr, "select VchNo from tbl_Voucher where vchtype='CR'  and VouchNo='" + txtvoucherno.Text + "'", con);
                if (dr.HasRows == true)
                {
                    dr.Read();
                    VchNo = Convert.ToInt16(dr[0]);
                }
                dr.Close();
                SqlTransaction trn;
                trn = c.myconn.BeginTransaction();
                try
                {
                    string mysql;
                    mysql = "delete from tbl_Voucher where vchtype='CR'  and VouchNo='" + txtvoucherno.Text + "'";
                    c.connectsql(mysql, c.myconn, trn);
                    mysql = "delete from tbl_VoucherDetail where  vchtype='CR' and VouchNo='" + txtvoucherno.Text + "'";
                    c.connectsql(mysql, c.myconn, trn);
                    mysql = "insert into tbl_Voucher(YearNo,VchNo,VouchNo,VchType,VchDate,Remark)values('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dtp.Value.Date + "','" + txtRemark.Text + "')";
                    c.connectsql(mysql, c.myconn, trn);
                    mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,cashbankno) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + BHM_DES + "','" + dtp.Value.Date + "'," + txtReceiptAmt.Text + "," + BHM_DES + ")";
                    c.connectsql(mysql, c.myconn, trn);
                    mysql = "insert into tbl_VoucherDetail (YearNo,vchno,VouchNo,VchType,AccCode,VchDate,Amount,cashbankno) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + valcmbaccountgroup.SelectedValue + "','" + dtp.Value.Date + "'," + -1 * Convert.ToDecimal(txtReceiptAmt.Text) + ",0)";
                    c.connectsql(mysql, c.myconn, trn);
                    trn.Commit();
                    MessageBox.Show("Record Update...");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    trn.Rollback();
                }
                trn.Dispose();
            }
mline:
            c.GetMdiParent(this).EnableAllEditMenuButtons();

            DesignForm.fromDesign1(this);
        }
Esempio n. 9
0
        public override void btnsave_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Strenght Null Value Not Allowed.");
            }
            else
            {
                if (valcmbclass.SelectedIndex == 0)
                {
                    valcmbclass.SelectedIndex = 0;
                }
                if (valcmbsankay.SelectedIndex == 0)
                {
                    valcmbsankay.SelectedIndex = 0;
                }
                if (valcmbsection.SelectedIndex == 0)
                {
                    valcmbsection.SelectedIndex = 0;
                }
                if (add_edit == true)
                {
                    c.returnconn(c.myconn);
                    SqlCommand command = new SqlCommand("select max(classno) from tbl_class", c.myconn);
                    command.CommandTimeout = 120;
                    Int32 mstudentno;
                    mstudentno = 101;
                    if (command.ExecuteScalar() != System.DBNull.Value)
                    {
                        mstudentno = Convert.ToInt32(command.ExecuteScalar()) + 1;
                    }
                    DataSet ds = Connection.GetDataSet("select count(*) from tbl_class where sectioncode='" + valcmbsection.SelectedValue.ToString() + "' and classcode='" + valcmbclass.SelectedValue.ToString() + "' and sankaycode ='" + valcmbsankay.SelectedValue.ToString() + "'");
                    int     i  = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
                    if (i == 0)
                    {
                        txtclasscode.Text = mstudentno.ToString();
                        c.insertdata("tbl_class", c.myconn, this);
                        MessageBox.Show("Record Saved.", "School");
                    }
                    else
                    {
                        MessageBox.Show("Duplicate data not allowed.");
                    }
                }
                if (add_edit == false)
                {
                    //c.updatedata("tbl_class", c.myconn, this, "classno", txtclasscode.Text);

                    string        uqry = "update tbl_class set classcode=@classcode,sectioncode=@sectioncode,sankaycode=@sankaycode,strength=@strength where classno=@classno";
                    SqlConnection conu = Connection.Conn();
                    SqlCommand    cmdu = new SqlCommand(uqry, conu);
                    cmdu.Parameters.AddWithValue("@classcode", valcmbclass.SelectedValue.ToString().Trim());
                    cmdu.Parameters.AddWithValue("@sectioncode", valcmbsection.SelectedValue.ToString().Trim());
                    cmdu.Parameters.AddWithValue("@sankaycode", valcmbsankay.SelectedValue.ToString().Trim());
                    cmdu.Parameters.AddWithValue("@strength", textBox1.Text.Trim());
                    cmdu.Parameters.AddWithValue("@classno", txtclasscode.Text.Trim());
                    conu.Open();
                    cmdu.ExecuteNonQuery();
                    conu.Close();
                    MessageBox.Show("Record Updated.", "School");
                }

                c.FillListBox("select a.classno,b.classname+' '+c.sectionname   as class from tbl_class a,tbl_classmaster b,tbl_section c where b.classcode=a.classcode and c.sectioncode=a.sectioncode order by a.classcode,c.sectioncode", "class", "classno", ref listBox1);
                c.GetMdiParent(this).EnableAllEditMenuButtons();
            }
            DesignForm.fromDesign1(this);
        }
Esempio n. 10
0
        public override void btnsave_Click(object sender, EventArgs e)
        {
            if (add_edit == true)
            {
                Connection.AllPerform("insert into tbl_school(schoolname, schooladdress, schoolcity, schoolphone, affiliate_by, principal, registrationno,Website,SchoolCode) values('" + txtinstitute.Text + "','" + txtaddress.Text + "','" + txtcity.Text + "','" + txtphone.Text + "','" + txtaffiliate.Text + "','" + txtprincipal.Text + "','" + txtregno.Text + "','" + txtWebsite.Text.Trim() + "', '" + txtSchoolCode.Text.Trim() + "')");

                // c.insertdata("tbl_school", c.myconn, this);
            }
            if (add_edit == false)
            {
                if (PicturePath != null)
                {
                    FileStream fs1;
                    fs1 = new FileStream(PicturePath, FileMode.Open, FileAccess.Read);
                    //a byte array to read the image
                    byte[] picbyte1 = new byte[fs1.Length];
                    fs1.Read(picbyte1, 0, System.Convert.ToInt32(fs1.Length));
                    System.Threading.Thread.Sleep(1000);
                    fs1.Flush();
                    fs1.Close();

                    Bitmap   bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Size.Width, Screen.PrimaryScreen.Bounds.Size.Height);
                    Graphics g   = Graphics.FromImage(bmp);
                    g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
                    g.Save();
                    bmp.Save(@"" + Connection.GetAccessPathId() + @"Images\" + txtinstitute.Text + ".jpg", ImageFormat.Bmp);

                    Bitmap   oBitmap  = new Bitmap(PicturePath);
                    Graphics oGraphic = Graphics.FromImage(oBitmap);
                    oBitmap.Save(@"" + Connection.GetAccessPathId() + @"Images\" + txtinstitute.Text + ".jpg", ImageFormat.Jpeg);
                    oBitmap.Dispose();
                    oGraphic.Dispose();
                    string        str1 = "Update tbl_school set LOGOimage=@simage  ";
                    SqlConnection con  = Connection.Conn();
                    SqlCommand    cmd  = new SqlCommand(str1, con);

                    cmd.Parameters.AddWithValue("@simage", picbyte1);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                }
                Update_HOESIGN();
                Update_PEINCSIGN();

                //Connection.AllPerform("update tbl_school set  schoolname='" + txtinstitute.Text + "',schooladdress='" + txtaddress.Text + "',schoolcity='" + txtcity.Text + "',schoolphone='" + txtphone.Text + "',affiliate_by='" + txtaffiliate.Text + "',principal='" + txtprincipal.Text + "',registrationno='" + txtregno.Text + "',Website='" + txtWebsite.Text.Trim() + "', SchoolCode = '"+txtSchoolCode.Text.Trim()+"'");
                string        updateqry = "update tbl_school set  schoolname=@schoolname,schooladdress=@schooladdress,schoolcity=@schoolcity,schoolphone=@schoolphone,affiliate_by=@affiliate_by,principal=@principal,registrationno=@registrationno,Website=@Website,SchoolCode=@SchoolCode";
                SqlConnection conu      = Connection.Conn();
                SqlCommand    cmdu      = new SqlCommand(updateqry, conu);
                cmdu.Parameters.AddWithValue("@schoolname", txtinstitute.Text.Trim());
                cmdu.Parameters.AddWithValue("@schooladdress", txtaddress.Text.Trim());
                cmdu.Parameters.AddWithValue("@schoolcity", txtcity.Text.Trim());
                cmdu.Parameters.AddWithValue("@schoolphone", txtphone.Text.Trim());
                cmdu.Parameters.AddWithValue("@affiliate_by", txtaffiliate.Text.Trim());
                cmdu.Parameters.AddWithValue("@principal", txtprincipal.Text.Trim());
                cmdu.Parameters.AddWithValue("@registrationno", txtregno.Text.Trim());
                cmdu.Parameters.AddWithValue("@Website", txtWebsite.Text.Trim());
                cmdu.Parameters.AddWithValue("@SchoolCode", txtSchoolCode.Text.Trim());
                conu.Open();
                cmdu.ExecuteNonQuery();
                conu.Close();
                //c.connectsql("insert into tbl_classstudent (studentno,classno,sessioncode) values ('" + txtstudentno.Text + "','" + classno + "','" + valcmbsession.SelectedValue + "')", c.myconn, trn);
            }
            MessageBox.Show("Record Saved...", "School");
            c.GetMdiParent(this).EnableAllEditMenuButtons();

            c.GetMdiParent(this).ToggleNewButton(false);
            c.GetMdiParent(this).ToggleDeleteButton(false);
            DesignForm.fromDesign1(this);
        }
Esempio n. 11
0
 public Distic_Setup()
 {
     InitializeComponent();    DesignForm.fromDesign1(this);
     //Connection.SetUserControlTheme(this);
 }