コード例 #1
0
 private void Staf_f_Load(object sender, EventArgs e)
 {
     loadstaff();
     Mainclass.disable_reset(panel1);
     edit = 0;
     loadlist();
 }
コード例 #2
0
 private void Classes_Load(object sender, EventArgs e)
 {
     edit = 0;
     Mainclass.disable_reset(panel1);
     loadData();
     loadlist();
 }
コード例 #3
0
 private void Assignment_Load(object sender, EventArgs e)
 {
     dataGridView.AutoGenerateColumns = false;
     edit = 0;
     Mainclass.disable_reset(panel1);
     loadlist();
 }
コード例 #4
0
 private void deletebtn_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         obj.deletestaff(StaffID);
         Mainclass.ShowMsg(txt_name.Text + "  Deleted successfully.", "Success", "Success");
         Mainclass.disable_reset(panel1);
         loadstaff();
     }
 }
コード例 #5
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (txt_shift.Text == "")
            {
                errorlabelshiftname.Visible = true;
            }
            else
            {
                errorlabelshiftname.Visible = false;
            }

            if (Shiftcb.SelectedIndex == -1)
            {
                Errorlabeelshiftnumber.Visible = true;
            }
            else
            {
                Errorlabeelshiftnumber.Visible = false;
            }
            if (errorlabelshiftname.Visible || Errorlabeelshiftnumber.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    Shiftt   s         = new Shiftt();
                    TimeSpan startTime = new TimeSpan(Startpicker.Value.Hour, Startpicker.Value.Minute, Startpicker.Value.Second);
                    TimeSpan EndTime   = new TimeSpan(Endpicker.Value.Hour, Endpicker.Value.Minute, Endpicker.Value.Second);
                    obj.insertshift(txt_shift.Text, Convert.ToByte(Shiftcb.SelectedItem.ToString()), startTime, EndTime);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_shift.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }

                else if (edit == 1)
                {
                    TimeSpan startTime = new TimeSpan(Startpicker.Value.Hour, Startpicker.Value.Minute, Startpicker.Value.Second);
                    TimeSpan EndTime   = new TimeSpan(Endpicker.Value.Hour, Endpicker.Value.Minute, Endpicker.Value.Second);
                    obj.Updateshift(txt_shift.Text, Convert.ToByte(Shiftcb.SelectedItem.ToString()), startTime, EndTime, ShiftID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_shift.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #6
0
        private void btndelete_Click(object sender, EventArgs e)
        {
            if (edit == 1)
            {
                DialogResult dr = MessageBox.Show("Are you sure you want to delete " + Student_txt.Text + "  Admission Application ?", "Questions", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    obj.deleteadmission(AID);

                    Mainclass.ShowMsg(Student_txt.Text + " Application  deleted successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadata();
                }
            }
        }
コード例 #7
0
        private void deletebtn_Click(object sender, EventArgs e)
        {
            if (edit == 1)
            {
                DialogResult dr = MessageBox.Show("Are you sure you want to delete " + txt_Levelname.Text + "?", "Questions", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    obj.deleterole(LevelID);

                    Mainclass.ShowMsg(txt_Levelname.Text + "  deleted successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
            }
        }
コード例 #8
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (txt_subject.Text == "")
            {
                Errorlabelsubject.Visible = true;
            }
            else
            {
                Errorlabelsubject.Visible = false;
            }
            if (Errorlabelsubject.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    try
                    {
                        Subject c = new Subject();
                        c.Subname = txt_subject.Text;


                        //obj.roles.InsertOnSubmit(r);
                        obj.insertsubject(txt_subject.Text);
                        obj.SubmitChanges();
                        Mainclass.ShowMsg(txt_subject.Text + "  added successfully.", "Success...", "Success");
                        Mainclass.disable_reset(panel1);
                        loadData();
                    }
                    catch (Exception ex)

                    {
                        Mainclass.ShowMsg("Are trying to insert same lines", "Error", "Error");
                    }
                }
                else if (edit == 1)
                {
                    obj.updatesubject(txt_subject.Text, SubjectID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_subject.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #9
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            byte admissionFeestatus = Admisssioncheckbox.Checked ? Convert.ToByte(1) : Convert.ToByte(0);
            byte sportFeeStatus     = Sportcheckbox.Checked ? Convert.ToByte(1) : Convert.ToByte(0);
            byte SecuirityFeeStatus = Securitycheckbox.Checked ? Convert.ToByte(1) : Convert.ToByte(0);
            byte courseFeestatus    = Coursefeecheck.Checked ? Convert.ToByte(1) : Convert.ToByte(0);
            byte otherfeestatus     = otherscb.Checked ? Convert.ToByte(1) : Convert.ToByte(0);

            if (edit == 0)
            {
                foreach (DataGridViewRow row in dataGridView2.Rows)
                {
                    string reason; float discount;
                    if (row.Cells["ReasonGV"].Value == null || row.Cells["ReasonGV"].Value.ToString() == "")
                    {
                        reason = "";
                    }
                    else
                    {
                        reason = row.Cells["ReasonGV"].Value.ToString();
                    }
                    if (row.Cells["DiscountGV"].Value == null || row.Cells["DiscountGV"].Value.ToString() == "")
                    {
                        discount = 0;
                    }
                    else
                    {
                        discount = Convert.ToSingle(row.Cells["DiscountGV"].Value.ToString());
                    }
                    obj.insertintoFeeVoucher(Convert.ToByte(dateTimePicker1.Value.Month), Convert.ToByte(dateTimePicker1.Value.Year),
                                             Convert.ToInt16(row.Cells["StudentIDGV"].Value.ToString()),
                                             Convert.ToInt32(classcb.SelectedValue.ToString()),
                                             dateTimePicker2.Value, discount, 0, Convert.ToByte(paymentcb.SelectedValue.ToString()), 0, reason,
                                             admissionFeestatus, sportFeeStatus, courseFeestatus, SecuirityFeeStatus,
                                             otherfeestatus);
                }
                Mainclass.ShowMsg(classcb.Text + " Voucher added successfully.", "Success...", "Success");
                Mainclass.disable_reset(panel1);
            }
            else
            {
                Mainclass.ShowMsg(classcb.Text + " Voucher Updated successfully.", "Success...", "Success");
                Mainclass.disable_reset(panel1);
            }
        }
コード例 #10
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txt_period.Text == "")
            {
                errorlabelperiodname.Visible = true;
            }
            else
            {
                errorlabelperiodname.Visible = false;
            }

            if (errorlabelperiodname.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    Periods p = new Periods();
                    p.Periodname = txt_period.Text;

                    //obj.roles.InsertOnSubmit(r);
                    obj.insertperiod(txt_period.Text);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_period.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
                else if (edit == 1)
                {
                    obj.Updateperiod(txt_period.Text, PeriodID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_period.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #11
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (txt_Levelname.Text == "")
            {
                errorlabelname.Visible = true;
            }
            else
            {
                errorlabelname.Visible = false;
            }
            if (errorlabelname.Visible || errorlabelname.Visible)

            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    Levels s = new Levels();
                    obj.insertlevel(txt_Levelname.Text);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_Levelname.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }

                else if (edit == 1)
                {
                    obj.Updatelevel(txt_Levelname.Text, LevelID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_Levelname.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #12
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (Falcultycb.SelectedIndex != -1 && Falcultycb.SelectedIndex != 0)
            {
                txt_falculty.Text          = Falcultycb.SelectedValue.ToString();
                errorlabelFalculty.Visible = false;
            }
            else
            {
                errorlabelFalculty.Visible = true;
            }
            if (Classcb.SelectedIndex == -1)
            {
                errorlabelclass.Visible = true;
            }
            else
            {
                errorlabelclass.Visible = false;
            }

            if (comboBox2.SelectedIndex == -1)
            {
                errorlabelsubject.Visible = true;
            }
            else
            {
                errorlabelsubject.Visible = false;
            }

            if (errorlabelclass.Visible || errorlabelFalculty.Visible || errorlabelsubject.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    if (sectioncb.SelectedIndex != -1 && sectioncb.SelectedIndex != 0)
                    {
                        obj.insertassignment(Convert.ToInt32(Classcb.SelectedValue.ToString()), Convert.ToInt32(periodcb.SelectedValue.ToString()), Convert.ToInt32(comboBox2.SelectedValue.ToString()), Convert.ToInt32(Falcultycb.SelectedValue.ToString()), Convert.ToInt32(sectioncb.SelectedValue.ToString()));
                    }
                    else
                    {
                        obj.insertassignment(Convert.ToInt32(Classcb.SelectedValue.ToString()), Convert.ToInt32(periodcb.SelectedValue.ToString()), Convert.ToInt32(comboBox2.SelectedValue.ToString()), Convert.ToInt32(Falcultycb.SelectedValue.ToString()), null);
                    }

                    obj.SubmitChanges();
                    Mainclass.ShowMsg(Falcultycb.Text + " has been assigned to " + Classcb.Text + " added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
                else if (edit == 1)
                {
                    if (sectioncb.SelectedIndex != 1 && sectioncb.SelectedIndex != 0)
                    {
                        obj.Updatefalculty(Convert.ToInt32(Classcb.SelectedValue.ToString()), Convert.ToInt32(periodcb.SelectedValue.ToString()), Convert.ToInt32(comboBox2.SelectedValue.ToString()), Convert.ToInt32(Falcultycb.SelectedItem.ToString()), assignmentID, Convert.ToInt32(sectioncb.SelectedValue.ToString()));
                    }
                    else
                    {
                        obj.Updatefalculty(Convert.ToInt32(Classcb.SelectedValue.ToString()), Convert.ToInt32(periodcb.SelectedValue.ToString()), Convert.ToInt32(comboBox2.SelectedValue.ToString()), Convert.ToInt32(Falcultycb.SelectedValue.ToString()), assignmentID, null);
                    }



                    obj.SubmitChanges();
                    Mainclass.ShowMsg(Falcultycb.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #13
0
 private void FeeMethod_Load(object sender, EventArgs e)
 {
     loadata();
     Mainclass.disable_reset(panel1);
 }
コード例 #14
0
 private void Level_Load(object sender, EventArgs e)
 {
     Mainclass.disable_reset(panel1);
     edit = 0;
     loadData();
 }
コード例 #15
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txt_role.Text == "")
            {
                erreorlabelrole.Visible = true;
            }
            else
            {
                erreorlabelrole.Visible = false;
            }
            if (rolestatuscb.SelectedIndex == -1)
            {
                errorlabelrolestatus.Visible = true;
            }
            else
            {
                errorlabelrolestatus.Visible = false;
            }
            if (erreorlabelrole.Visible || errorlabelrolestatus.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    role r = new role();
                    r.rolename = txt_role.Text;
                    if (rolestatuscb.SelectedIndex == 0)
                    {
                        r.rolestatus = 1;
                    }
                    else
                    {
                        r.rolestatus = 0;
                    }
                    //obj.roles.InsertOnSubmit(r);
                    obj.InsertRole(txt_role.Text, r.rolestatus);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_role.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
                else if (edit == 1)
                {
                    byte stat;
                    if (rolestatuscb.SelectedIndex == 0)
                    {
                        stat = 1;
                    }
                    else
                    {
                        stat = 0;
                    }

                    obj.UpdateRole(txt_role.Text, stat, roleID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_role.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();



                    //var data = obj.roles.Single(x => x.rolesID == roleID);

                    //data.rolename = txt_role.Text;
                    //if (rolestatuscb.SelectedIndex== 0)
                    //{

                    //    data.rolestatus = 1;

                    //}
                    //else
                    //{

                    //    data.rolestatus = 0;

                    //}
                    ////obj.roles.InsertOnSubmit(r);

                    //obj.SubmitChanges();
                    //Mainclass.ShowMsg(txt_role.Text + "  Updated successfully.", "Success...", "Success");
                    //Mainclass.disable_reset(panel1);
                    //loadData();
                }
            }
        }
コード例 #16
0
 private void Fee_Structure_Load(object sender, EventArgs e)
 {
     loadata();
     Mainclass.disable_reset(panel1);
     Loadlist();
 }
コード例 #17
0
 private void Period_Load(object sender, EventArgs e)
 {
     edit = 0;
     Mainclass.disable_reset(panel1);
 }
コード例 #18
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (txt_name.Text == "")
            {
                errorlabelname.Visible = true;
            }
            else
            {
                errorlabelname.Visible = false;
            }
            if (txt_username.Text == "")
            {
                errorlabelusername.Visible = true;
            }
            else
            {
                errorlabelusername.Visible = false;
            }
            if (txt_password.Text == "")
            {
                errorlabelpassword.Visible = true;
            }
            else
            {
                errorlabelpassword.Visible = false;
            }
            if (txt_conpass.Text == "")
            {
                errorlabelconpass.Visible = true;
            }
            else
            {
                errorlabelconpass.Visible = false;
            }

            if (txt_phone.Text == "")
            {
                errorlabelphone.Visible = true;
            }
            else
            {
                errorlabelphone.Visible = false;
            }
            if (rolecb.SelectedIndex == -1)
            {
                erroelabelrole.Visible = true;
            }
            else
            {
                erroelabelrole.Visible = false;
            }
            if (rolestatus.SelectedIndex == -1)
            {
                errorlabelstatus.Visible = true;
            }
            else
            {
                errorlabelstatus.Visible = false;
            }

            if (errorlabelname.Visible || errorlabelusername.Visible || errorlabelpassword.Visible || errorlabelconpass.Visible || errorlabelphone.Visible || erroelabelrole.Visible || errorlabelstatus.Visible)
            {
                Mainclass.ShowMsg("Fields with * are mandatory", "Stop.....", "Error");
            }
            if (txt_password.Text != txt_conpass.Text)
            {
                MessageBox.Show("Password mismatched");
            }
            else
            {
                if (edit == 0)
                {
                    if (Image.Text == "")
                    {
                        byte stat = rolestatus.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0);
                        obj.InsertStaffwithoutimage(txt_name.Text, txt_username.Text, txt_password.Text, txt_phone.Text, txt_phone2.Text, Convert.ToInt32(rolecb.SelectedIndex.ToString()), stat);
                        Mainclass.ShowMsg(txt_name.Text + "  added successfully.", "Success", "Success");
                        Mainclass.disable_reset(panel1);
                        loadstaff();
                    }
                    else
                    {
                        byte         stat = rolestatus.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0);
                        MemoryStream ms   = new MemoryStream();
                        i.Save(ms, ImageFormat.Jpeg);
                        byte[] arr = ms.ToArray();
                        obj.InsertStaff(txt_name.Text, txt_username.Text, txt_password.Text, txt_phone.Text, txt_phone2.Text, Convert.ToInt32(rolecb.SelectedIndex.ToString()), stat, arr);
                        Mainclass.ShowMsg(txt_name.Text + "  added successfully.", "Success", "Success");
                        Mainclass.disable_reset(panel1);
                        loadstaff();
                    }
                }
                else if (edit == 1)
                {
                    byte stat = rolestatus.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0);
                    if (i == null)
                    {
                        obj.Updatestaffwithoutimage(txt_name.Text, txt_username.Text, txt_password.Text, txt_phone.Text, txt_phone2.Text, Convert.ToInt32(rolecb.SelectedIndex.ToString()), stat, StaffID);
                        Mainclass.ShowMsg(txt_name.Text + "  Updated successfully.", "Success", "Success");
                        Mainclass.disable_reset(panel1);
                        loadstaff();
                    }
                    else
                    {
                        MemoryStream ms = new MemoryStream();
                        i.Save(ms, ImageFormat.Jpeg);
                        byte[] arr = ms.ToArray();
                        obj.UpdateStaff(txt_name.Text, txt_username.Text, txt_password.Text, txt_phone.Text, txt_phone2.Text, Convert.ToInt32(rolecb.SelectedIndex.ToString()), stat, arr, StaffID);
                        Mainclass.ShowMsg(txt_name.Text + "  Updated successfully.", "Success", "Success");
                        Mainclass.disable_reset(panel1);
                        loadstaff();
                    }
                }
            }
        }
コード例 #19
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txt_sectionname.Text == "")
            {
                errorlabelsectionname.Visible = true;
            }
            else
            {
                errorlabelsectionname.Visible = false;
            }
            if (statuscb.SelectedIndex == -1)
            {
                errolabelstatus.Visible = true;
            }
            else
            {
                errolabelstatus.Visible = false;
            }
            if (errorlabelsectionname.Visible || errolabelstatus.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    section s = new section();
                    s.sec_name = txt_sectionname.Text;
                    if (statuscb.SelectedIndex == 0)
                    {
                        s.sec_status = 1;
                    }
                    else
                    {
                        s.sec_status = 0;
                    }

                    obj.insertsections(txt_sectionname.Text, s.sec_status);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_sectionname.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
                else if (edit == 1)
                {
                    byte stat;
                    if (statuscb.SelectedIndex == 0)
                    {
                        stat = 1;
                    }
                    else
                    {
                        stat = 0;
                    }

                    obj.UpdateSection(txt_sectionname.Text, stat, StatID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_sectionname.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #20
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txt_class.Text == "")
            {
                errorlabelclassname.Visible = true;
            }
            else
            {
                errorlabelclassname.Visible = false;
            }
            if (selection_cb.SelectedIndex == -1)
            {
                errorlabelsecctionname.Visible = true;
            }
            { errorlabelsecctionname.Visible = false; }
            if (Levelcb.SelectedIndex == -1)
            {
                errorlablelevel.Visible = true;
            }
            else
            {
                errorlablelevel.Visible = false;
            }
            if (errorlabelclassname.Visible || errorlabelsecctionname.Visible || errorlablelevel.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    Class c = new Class();
                    c.Class_name = txt_class.Text;
                    if (selection_cb.SelectedIndex == 0)
                    {
                        c.class_stat = 1;
                    }
                    else
                    {
                        c.class_stat = 0;
                    }
                    //obj.roles.InsertOnSubmit(r);
                    obj.insertclass(txt_class.Text, c.class_stat, Convert.ToInt32(Levelcb.SelectedValue.ToString()));
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_class.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
                else if (edit == 1)
                {
                    byte stat;
                    if (selection_cb.SelectedIndex == 0)
                    {
                        stat = 1;
                    }
                    else
                    {
                        stat = 0;
                    }

                    obj.updateclass(txt_class.Text, stat, Convert.ToInt32(Levelcb.SelectedValue.ToString()), ClassID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_class.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #21
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (periodcb.SelectedIndex == -1)
            {
                errorlabelperiodname.Visible = true;
            }
            else
            {
                errorlabelperiodname.Visible = false;
            }
            if (timeshiftcb.SelectedIndex == -1)
            {
                erroelabelshift.Visible = true;
            }
            else
            {
                erroelabelshift.Visible = false;
            }
            if (Timingdaycb.SelectedIndex == -1)
            {
                errorlabeltimingday.Visible = true;
            }
            else
            {
                errorlabeltimingday.Visible = false;
            }
            if (Timinglevelcb.SelectedIndex == -1)
            {
                errorlabeltiminglevel.Visible = true;
            }
            else
            {
                errorlabeltiminglevel.Visible = false;
            }
            if (errorlabelperiodname.Visible || erroelabelshift.Visible || errorlabeltimingday.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else

            {
                if (edit == 0)
                {
                    TimeSpan startTime = new TimeSpan(Starttimedp.Value.Hour, Starttimedp.Value.Minute, Starttimedp.Value.Second);
                    TimeSpan EndTime   = new TimeSpan(Endtimedp.Value.Hour, Endtimedp.Value.Minute, Endtimedp.Value.Second);


                    timing t = new timing();
                    obj.insertTiming(Convert.ToInt32(periodcb.SelectedValue.ToString()), Convert.ToInt32(timeshiftcb.SelectedValue.ToString()), startTime, EndTime, Timingdaycb.SelectedItem.ToString(), Convert.ToInt32(Timinglevelcb.SelectedValue.ToString()));
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(periodcb.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }

                else
                {
                    TimeSpan startTime = new TimeSpan(Starttimedp.Value.Hour, Starttimedp.Value.Minute, Starttimedp.Value.Second);
                    TimeSpan EndTime   = new TimeSpan(Endtimedp.Value.Hour, Endtimedp.Value.Minute, Endtimedp.Value.Second);
                    obj.updatetimings(Convert.ToInt32(periodcb.SelectedValue.ToString()), Convert.ToInt32(timeshiftcb.SelectedValue.ToString()), startTime, EndTime, Timingdaycb.SelectedItem.ToString(), Convert.ToInt32(Timinglevelcb.SelectedValue.ToString()), TimeID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(periodcb.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #22
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            if (txt_house.Text == "")
            {
                errorlabelhousename.Visible = true;
            }
            else
            {
                errorlabelhousename.Visible = false;
            }
            if (Statuscb.SelectedIndex == -1)
            {
                errorlabelhousestatus.Visible = true;
            }
            else
            {
                errorlabelhousestatus.Visible = false;
            }
            if (errorlabelhousename.Visible || errorlabelhousestatus.Visible)
            {
                Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error..");
            }
            else
            {
                if (edit == 0)
                {
                    Housee h = new Housee();
                    h.Housename = txt_house.Text;
                    if (Statuscb.SelectedIndex == 0)
                    {
                        h.Housestatus = 1;
                    }
                    else
                    {
                        h.Housestatus = 0;
                    }
                    //obj.roles.InsertOnSubmit(r);
                    obj.inserthouse(txt_house.Text, h.Housestatus);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_house.Text + "  added successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel1);
                    loadData();
                }
                else if (edit == 1)
                {
                    byte stat;
                    if (Statuscb.SelectedIndex == 0)
                    {
                        stat = 1;
                    }
                    else
                    {
                        stat = 0;
                    }

                    obj.UpdateRole(txt_house.Text, stat, HouseID);
                    obj.SubmitChanges();
                    Mainclass.ShowMsg(txt_house.Text + "  Updated successfully.", "Success...", "Success");
                    Mainclass.disable_reset(panel2);
                    loadData();
                }
            }
        }
コード例 #23
0
 private void FeeVoucher_Load(object sender, EventArgs e)
 {
     // loadata();
     Mainclass.disable_reset(panel1);
     loadlist();
 }