Esempio n. 1
0
        private void Main_Load(object sender, EventArgs e)
        {
            z_Notification jsi = new z_Notification();

            jsi.MdiParent    = this;
            lbl_modname.Text = btn_7.Text;
            btn_7.BackColor  = panel2.BackColor;
            colormain        = panel2.BackColor;
            color2           = Color.Peru;
            jsi.Show();
        }
Esempio n. 2
0
        private void btn_7_Click(object sender, EventArgs e)
        {
            z_Notification jsi = new z_Notification();

            closechild();
            btn_color_reset();

            jsi.MdiParent = this;

            lbl_modname.Text = btn_7.Text;
            btn_7.BackColor  = panel2.BackColor;
            colormain        = panel2.BackColor;
            color2           = Color.Peru;

            jsi.Show();
        }
Esempio n. 3
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_wtax";

            String code = "", description = "", exemption = "", bracket1 = "", bracket2 = "", bracket3 = "", bracket4 = "", bracket5 = "", bracket6 = "", bracket7 = "", bracket8 = "", bracket9 = "", bracket10 = "", factor1 = "", factor2 = "", factor3 = "", factor4 = "", factor5 = "", factor6 = "", factor7 = "", factor8 = "", factor9 = "", factor10 = "", add_on1 = "", add_on2 = "", add_on3 = "", add_on4 = "", add_on5 = "", add_on6 = "", add_on7 = "", add_on8 = "", add_on9 = "", add_on10 = "";


            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_description.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_exemption.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_1.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            if (txt_bracket_2.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            if (txt_bracket_3.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_4.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_5.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_6.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_7.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            if (txt_bracket_8.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_9.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_bracket_10.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            if (txt_factor_1.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_2.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_3.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_4.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_5.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_6.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_7.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_8.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_9.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_factor_10.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on1.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on2.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on3.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on4.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on5.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on6.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on7.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on8.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on9.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (txt_add_on10.Text == "")
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            code        = txt_code.Text;
            description = txt_description.Text;
            exemption   = txt_exemption.Text;
            bracket1    = txt_bracket_1.Text;
            bracket2    = txt_bracket_2.Text;
            bracket3    = txt_bracket_3.Text;
            bracket4    = txt_bracket_4.Text;
            bracket5    = txt_bracket_5.Text;
            bracket6    = txt_bracket_6.Text;
            bracket7    = txt_bracket_7.Text;
            bracket8    = txt_bracket_8.Text;
            bracket9    = txt_bracket_9.Text;
            bracket10   = txt_bracket_10.Text;

            factor1  = txt_factor_1.Text;
            factor2  = txt_factor_2.Text;
            factor3  = txt_factor_3.Text;
            factor4  = txt_factor_4.Text;
            factor5  = txt_factor_5.Text;
            factor6  = txt_factor_6.Text;
            factor7  = txt_factor_7.Text;
            factor8  = txt_factor_8.Text;
            factor9  = txt_factor_9.Text;
            factor10 = txt_factor_10.Text;

            add_on1  = txt_add_on1.Text;
            add_on2  = txt_add_on2.Text;
            add_on3  = txt_add_on3.Text;
            add_on4  = txt_add_on4.Text;
            add_on5  = txt_add_on5.Text;
            add_on6  = txt_add_on6.Text;
            add_on7  = txt_add_on7.Text;
            add_on8  = txt_add_on8.Text;
            add_on9  = txt_add_on9.Text;
            add_on10 = txt_add_on10.Text;

            if (isnew)
            {
                col = "code,description,exemption,bracket1,bracket2,bracket3,bracket4,bracket5,bracket6,bracket7,bracket8,bracket9,bracket10,factor1,factor2,factor3,factor4,factor5,factor6,factor7,factor8,factor9,factor10,add_on1,add_on2,add_on3,add_on4,add_on5,add_on6,add_on7,add_on8,add_on9,add_on10";
                val = "" + db.str_E(code) + "," + db.str_E(description) + "," + db.str_E(exemption) + ",'" + bracket1 + "','" + bracket2 + "','" + bracket3 + "','" + bracket4 + "','" + bracket5 + "','" + bracket6 + "','" + bracket7 + "','" + bracket8 + "','" + bracket9 + "','" + bracket10 + "','" + factor1 + "','" + factor2 + "','" + factor3 + "','" + factor4 + "','" + factor5 + "','" + factor6 + "','" + factor7 + "','" + factor8 + "','" + factor9 + "','" + factor10 + "','" + add_on1 + "','" + add_on2 + "','" + add_on3 + "','" + add_on4 + "','" + add_on5 + "','" + add_on6 + "','" + add_on7 + "','" + add_on8 + "','" + add_on9 + "','" + add_on10 + "'";

                db.DeleteOnTable(table, "code=" + db.str_E(code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "description=" + db.str_E(description) + ",exemption=" + db.str_E(exemption) + ",bracket1='" + bracket1 + "',bracket2='" + bracket2 + "',bracket3='" + bracket3 + "',bracket4='" + bracket4 + "',bracket5='" + bracket5 + "',bracket6='" + bracket6 + "',bracket7='" + bracket7 + "',bracket8='" + bracket8 + "',bracket9='" + bracket9 + "',bracket10='" + bracket10 + "',factor1='" + factor1 + "',factor2='" + factor2 + "',factor3='" + factor3 + "',factor4='" + factor4 + "',factor5='" + factor5 + "',factor6='" + factor6 + "',factor7='" + factor7 + "',factor8='" + factor8 + "',factor9='" + factor9 + "',factor10='" + factor10 + "',add_on1='" + add_on1 + "',add_on2='" + add_on2 + "',add_on3='" + add_on3 + "',add_on4='" + add_on4 + "',add_on5='" + add_on5 + "',add_on6='" + add_on6 + "',add_on7='" + add_on7 + "',add_on8='" + add_on8 + "',add_on9='" + add_on9 + "',add_on10='" + add_on10 + "'";
                if (db.UpdateOnTable(table, col, "code=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                CleanForm();
                goto_win1();
                disp_list();
            }
        }
Esempio n. 4
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_philhealth";

            String code = "", bracket1 = "", bracket2 = "", salary_base = "", emp_er = "", emp_ee = "";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            code        = txt_code.Text;
            bracket1    = txt_bracket1.Text;
            bracket2    = txt_bracket2.Text;
            salary_base = txt_salary_base.Text;
            emp_er      = txt_emp_er.Text;
            emp_ee      = txt_emp_ee.Text;

            if (isnew)
            {
                col = "code,bracket1,bracket2,salary_base,emp_er,emp_ee";
                val = "" + db.str_E(code) + ",'" + bracket1 + "','" + bracket2 + "','" + salary_base + "','" + emp_er + "','" + emp_ee + "'";

                db.DeleteOnTable(table, "code=" + db.str_E(code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "bracket1='" + bracket1 + "',bracket2='" + bracket2 + "',salary_base='" + salary_base + "',emp_er='" + emp_er + "',emp_ee='" + emp_ee + "'";

                if (db.UpdateOnTable(table, col, "code=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                goto_win1();
                frm_clear();
                disp_list();
            }
        }
Esempio n. 5
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "", add_col = "", add_val = "";
            String notifyadd = null;
            String table = "hr_employee";
            String code = "", lastname = "", firstname = "", mi = "", section = "", position = "", picture = "", department = "", date_hired = "1900-01-01", contractual_date = "1900-01-01", prohibition_date = "1900-01-01", date_regular = "1900-01-01", date_resigned = "1900-01-01", date_terminated = "1900-01-01", empstatus = "", contract_days = "0", prc = "", ctc = "", rate_type = "", pay_rate = "", biometric = "", sss = "", pagibig = "", philhealth = "", payroll_account = "", tin = "", tax_bracket = "", shift_sched_from = "", dayoff1 = "", dayoff2 = "", sex = "", birth = "", civil_status = "", religion = "", height = "0.00", weight = "0.00", father = "", father_address = "", father_contact = "", father_job = "", mother = "", mother_address = "", mother_contact = "", mother_job = "", emp_contact = "", home_tel = "", email = "", home_address = "", emergency_name = "", emergency_contact = "", em_home_address = "", relationship = "", shift_sched_sat_from = "", shift_sched_to = "", shift_sched_sat_to = "", fixed_rate = "", primary = "", secondary = "", tertiary = "", graduate = "", post_graduate = "", sss_bracket = "", pagibig_bracket = "", philhealth_bracket = "", shift_sched_sat = "", shift_sched = "";

            if (String.IsNullOrEmpty(txt_lastname.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_firstname.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (cbo_shiftsched.SelectedIndex == -1)
            {
                MessageBox.Show("Please select shift schedule");
                cbo_shiftsched.DroppedDown = true;
                return;
            }

            if (String.IsNullOrEmpty(txt_mi.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            if (cbo_department.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a department.");
                cbo_department.DroppedDown = true;
                return;
            }

            if (cbo_section.Items.Count > 0)
            {
                if (cbo_section.SelectedIndex == -1)
                {
                    MessageBox.Show("Please select department section.");
                    cbo_section.DroppedDown = true;
                    return;
                }
            }


            if (cbo_position.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a position.");
                cbo_position.DroppedDown = true;
                return;
            }

            if (cbo_status.SelectedIndex == -1)
            {
                MessageBox.Show("Please select employee status.");
                cbo_status.DroppedDown = true;
                return;
            }
            if (dtp_hired.Value.ToShortDateString() == null)
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (cbo_rate_type.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a rate type.");
                cbo_rate_type.DroppedDown = true;
                return;
            }
            if (cbo_tax_bracket.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a tax bracket.");
                cbo_tax_bracket.DroppedDown = true;
                return;
            }
            if (cbo_gender.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a gender.");
                cbo_gender.DroppedDown = true;
                return;
            }
            if (!String.IsNullOrEmpty(txt_sss_num.Text) && cbo_sss.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a sss bracket.");
                cbo_sss.DroppedDown = true;
                return;
            }
            if (!String.IsNullOrEmpty(txt_pagibig.Text) && cbo_pagibig.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a pagibig bracket.");
                cbo_pagibig.DroppedDown = true;
                return;
            }
            if (!String.IsNullOrEmpty(txt_philhealth.Text) && cbo_philhealth.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a philhealth bracket.");
                cbo_philhealth.DroppedDown = true;
                return;
            }

            lastname  = txt_lastname.Text;
            firstname = txt_firstname.Text;
            mi        = txt_mi.Text;
            if (cbo_department.SelectedIndex != -1)
            {
                department = cbo_department.SelectedValue.ToString();
            }

            if (cbo_section.SelectedIndex != -1)
            {
                section = cbo_section.SelectedValue.ToString();
            }
            if (cbo_position.SelectedIndex != -1)
            {
                position = cbo_position.SelectedValue.ToString();
            }

            date_hired = dtp_hired.Value.ToString("yyyy-MM-dd");

            if (cbo_status.SelectedIndex != -1)
            {
                empstatus = cbo_status.SelectedValue.ToString();
            }

            if (txt_contract_days.Text != "")
            {
                contract_days = txt_contract_days.Text;
            }
            prc = txt_prc_number.Text;
            ctc = txt_ctc_num.Text;

            if (cbo_rate_type.SelectedIndex != -1)
            {
                rate_type = cbo_rate_type.SelectedValue.ToString();
            }

            pay_rate        = txt_pay_rate.Text;
            biometric       = txt_biometric.Text;
            sss             = txt_sss_num.Text;
            pagibig         = txt_pagibig.Text;
            philhealth      = txt_philhealth.Text;
            payroll_account = txt_payroll_act.Text;
            tin             = txt_tin.Text;
            if (cbo_tax_bracket.SelectedIndex != -1)
            {
                tax_bracket = cbo_tax_bracket.SelectedValue.ToString();
            }



            shift_sched_from     = date_shift_sched_from.Value.ToString("HH:mm");
            shift_sched_to       = date_shift_sched_to.Value.ToString("HH:mm");
            shift_sched_sat_from = date_sift_sched_sat_from.Value.ToString("HH:mm");
            shift_sched_sat_to   = date_sift_sched_sat_to.Value.ToString("HH:mm");

            shift_sched     = (cbo_shiftsched.SelectedValue ?? "").ToString();
            shift_sched_sat = (cbo_shiftsched_sat.SelectedValue ?? "").ToString();

            if (cbo_gender.SelectedIndex != -1)
            {
                sex = cbo_gender.SelectedItem.ToString();
            }

            birth = date_birth.Value.ToShortDateString();
            if (cbo_civil_stat.SelectedIndex != -1)
            {
                civil_status = cbo_civil_stat.SelectedValue.ToString();
            }

            religion = txt_religion.Text;
            if (txt_height.Text != "")
            {
                height = txt_height.Text;
            }
            if (txt_weight.Text != "")
            {
                weight = txt_weight.Text;
            }

            if (chk_fixed_rate.Checked == true)
            {
                fixed_rate = "1";
            }

            father            = txt_father.Text;
            father_address    = txt_father_address.Text;
            father_contact    = txt_father_contact.Text;
            father_job        = txt_father_occupation.Text;
            mother            = txt_mother.Text;
            mother_address    = txt_mother_address.Text;
            mother_contact    = txt_mother_contact.Text;
            mother_job        = txt_mother_occupation.Text;
            emp_contact       = txt_contact_no.Text;
            home_tel          = txt_home_tel.Text;
            email             = txt_email.Text;
            home_address      = txt_home_address.Text;
            emergency_name    = txt_ctc_name.Text;
            emergency_contact = txt_ctc_no.Text;
            em_home_address   = txt_home_add.Text;
            relationship      = txt_relation.Text;
            primary           = txt_primary.Text;
            secondary         = txt_secondary.Text;
            tertiary          = txt_tertiary.Text;
            graduate          = txt_graduate.Text;
            post_graduate     = txt_post_graduate.Text;

            sss_bracket        = (cbo_sss.SelectedValue ?? "").ToString();
            pagibig_bracket    = (cbo_pagibig.SelectedValue ?? "").ToString();
            philhealth_bracket = (cbo_philhealth.SelectedValue ?? "").ToString();

            if (cbo_dayoff1.SelectedIndex != -1)
            {
                dayoff1 = cbo_dayoff1.SelectedValue.ToString();
            }
            if (cbo_dayoff2.SelectedIndex != -1)
            {
                dayoff2 = cbo_dayoff2.SelectedValue.ToString();
            }


            if (chk_resigned.Checked == true)
            {
                date_resigned = dtp_resigned.Value.ToString("yyyy-MM-dd");
            }
            if (chk_terminated.Checked == true)
            {
                date_terminated = dtp_terminated.Value.ToString("yyyy-MM-dd");
            }
            if (chk_contractual.Checked == true)
            {
                contractual_date = dtp_contractual.Value.ToString("yyyy-MM-dd");
            }
            if (chk_probition.Checked == true)
            {
                prohibition_date = dtp_probitioned.Value.ToString("yyyy-MM-dd");
            }
            if (chk_regular.Checked == true)
            {
                date_regular = dtp_regularized.Value.ToString("yyyy-MM-dd");
            }

            if (isnew)
            {
                code = code = db.get_pk("empid"); //changes from 'hr_empid'
                col  = "empid,lastname,firstname,mi,positions,department,section,date_hired,contractual_date,date_resigned,date_terminated,prohibition_date,date_regular,empstatus,contract_days,prc,ctc,rate_type,pay_rate,biometric,sss,pagibig,philhealth,payroll_account,tin,tax_bracket,shift_sched_from,dayoff1,dayoff2,sex,birth,civil_status,religion,height,weight,father,father_address,father_contact,father_job,mother,mother_address,mother_contact,mother_job,emp_contact,home_tel,email,home_address,emergency_name,emergency_contact,em_home_address,relationship,shift_sched_sat_from,shift_sched_to,shift_sched_sat_to,fixed_rate,primary_ed,secondary_ed,tertiary_ed,graduate,post_graduate,sss_bracket,pagibig_bracket,philhealth_bracket,shift_sched,shift_sched_sat";
                val  = "" + db.str_E(code) + "," + db.str_E(lastname) + "," + db.str_E(firstname) + "," + db.str_E(mi) + "," + db.str_E(position) + "," + db.str_E(department) + "," + db.str_E(section) + ",'" + date_hired + "','" + contractual_date + "','" + date_resigned + "','" + date_terminated + "','" + prohibition_date + "','" + date_regular + "'," + db.str_E(empstatus) + "," + db.str_E(contract_days) + "," + db.str_E(prc) + "," + db.str_E(ctc) + "," + db.str_E(rate_type) + "," + db.str_E(pay_rate) + "," + db.str_E(biometric) + "," + db.str_E(sss) + "," + db.str_E(pagibig) + ", " + db.str_E(philhealth) + "," + db.str_E(payroll_account) + "," + db.str_E(tin) + "," + db.str_E(tax_bracket) + "," + db.str_E(shift_sched_from) + "," + db.str_E(dayoff1) + "," + db.str_E(dayoff2) + "," + db.str_E(sex) + "," + db.str_E(birth) + "," + db.str_E(civil_status) + "," + db.str_E(religion) + "," + db.str_E(height) + "," + db.str_E(weight) + "," + db.str_E(father) + "," + db.str_E(father_address) + "," + db.str_E(father_contact) + "," + db.str_E(father_job) + "," + db.str_E(mother) + "," + db.str_E(mother_address) + "," + db.str_E(mother_contact) + "," + db.str_E(mother_job) + "," + db.str_E(emp_contact) + "," + db.str_E(home_tel) + "," + db.str_E(email) + "," + db.str_E(home_address) + "," + db.str_E(emergency_name) + "," + db.str_E(emergency_contact) + "," + db.str_E(em_home_address) + "," + db.str_E(relationship) + "," + db.str_E(shift_sched_sat_from) + "," + db.str_E(shift_sched_to) + "," + db.str_E(shift_sched_sat_to) + "," + db.str_E(fixed_rate) + "," + db.str_E(primary) + "," + db.str_E(secondary) + "," + db.str_E(tertiary) + "," + db.str_E(graduate) + "," + db.str_E(post_graduate) + "," + db.str_E(sss_bracket) + "," + db.str_E(pagibig_bracket) + "," + db.str_E(philhealth_bracket) + "," + db.str_E(shift_sched) + "," + db.str_E(shift_sched_sat) + "";

                //db.DeleteOnTable(table, "empid='" + code + "' AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                    db.set_pkm99("empid", db.get_nextincrementlimitchar(code, 8)); //changes from 'hr_empid'
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "empid='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col  = "lastname=" + db.str_E(lastname) + ",firstname=" + db.str_E(firstname) + ",mi=" + db.str_E(mi) + ",positions=" + db.str_E(position) + ",department=" + db.str_E(department) + ",section =" + db.str_E(section) + ",date_hired='" + date_hired + "',contractual_date='" + contractual_date + "',date_resigned = '" + date_resigned + "',date_terminated='" + date_terminated + "',prohibition_date = '" + prohibition_date + "',date_regular ='" + date_regular + "',empstatus=" + db.str_E(empstatus) + ",contract_days=" + db.str_E(contract_days) + ",prc=" + db.str_E(prc) + ",ctc=" + db.str_E(ctc) + ",rate_type=" + db.str_E(rate_type) + ",pay_rate=" + db.str_E(pay_rate) + ",biometric=" + db.str_E(biometric) + ",sss=" + db.str_E(sss) + ",pagibig=" + db.str_E(pagibig) + ",philhealth=" + db.str_E(philhealth) + ",payroll_account=" + db.str_E(payroll_account) + ",tin=" + db.str_E(tin) + ",tax_bracket=" + db.str_E(tax_bracket) + ", shift_sched_from=" + db.str_E(shift_sched_from) + ",dayoff1=" + db.str_E(dayoff1) + ",dayoff2=" + db.str_E(dayoff2) + ",sex=" + db.str_E(sex) + ",birth=" + db.str_E(birth) + ",civil_status=" + db.str_E(civil_status) + ",religion=" + db.str_E(religion) + ",height=" + db.str_E(height) + ",weight=" + db.str_E(weight) + ",father=" + db.str_E(father) + ",father_address=" + db.str_E(father_address) + ", father_contact=" + db.str_E(father_contact) + ",father_job=" + db.str_E(father_job) + ",mother=" + db.str_E(mother) + ", mother_address=" + db.str_E(mother_address) + ",mother_contact=" + db.str_E(mother_contact) + ", mother_job=" + db.str_E(mother_job) + ", emp_contact=" + db.str_E(emp_contact) + ", home_tel=" + db.str_E(home_tel) + ",email=" + db.str_E(email) + ", home_address=" + db.str_E(home_address) + ",emergency_name=" + db.str_E(emergency_name) + ", emergency_contact=" + db.str_E(emergency_contact) + ",em_home_address=" + db.str_E(em_home_address) + ",relationship=" + db.str_E(relationship) + ",shift_sched_sat_from=" + db.str_E(shift_sched_sat_from) + ",shift_sched_to=" + db.str_E(shift_sched_to) + ",shift_sched_sat_to=" + db.str_E(shift_sched_sat_to) + ",fixed_rate=" + db.str_E(fixed_rate) + ",primary_ed=" + db.str_E(primary) + ",secondary_ed=" + db.str_E(secondary) + ",tertiary_ed=" + db.str_E(tertiary) + ",graduate=" + db.str_E(graduate) + ",post_graduate=" + db.str_E(post_graduate) + ",sss_bracket=" + db.str_E(sss_bracket) + ",pagibig_bracket=" + db.str_E(pagibig_bracket) + ",philhealth_bracket=" + db.str_E(philhealth_bracket) + ",shift_sched=" + db.str_E(shift_sched) + ",shift_sched_sat=" + db.str_E(shift_sched_sat) + " ";
                code = txt_code.Text;
                if (db.UpdateOnTable(table, col, "empid=" + db.str_E(code) + ""))
                {
                    if (prev_pay_rate != pay_rate)
                    {
                        String payrate_dt = DateTime.Now.ToString("yyyy-MM-dd");
                        if (String.IsNullOrEmpty(db.get_colval("hr_emp_payrate_history", "empid", "empid=" + db.str_E(code) + " AND payrate_dt='" + payrate_dt + "'")))
                        {
                            db.InsertOnTable("hr_emp_payrate_history", "empid, pay_rate, rate_type, payrate_dt", "" + db.str_E(code) + ", " + db.str_E(prev_pay_rate) + "," + db.str_E(prev_rate_type) + ",'" + payrate_dt + "' ");
                        }
                    }
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                disp_list();
                goto_win1();
                frm_clear();
            }
        }
Esempio n. 6
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_sss";


            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            String code        = txt_code.Text;
            String bracket1    = gm.toNormalDoubleFormat(txt_bracket1.Text).ToString("0.00");
            String bracket2    = gm.toNormalDoubleFormat(txt_bracket2.Text).ToString("0.00");
            String s_credit    = gm.toNormalDoubleFormat(txt_s_credit.Text).ToString("0.00");
            String empshare_sc = gm.toNormalDoubleFormat(txt_empshare_sc.Text).ToString("0.00");
            String s_ec        = gm.toNormalDoubleFormat(txt_s_ec.Text).ToString("0.00");
            String empshare_ec = gm.toNormalDoubleFormat(txt_empshare_ec.Text).ToString("0.00");

            if (isnew)
            {
                col = "code,bracket1,bracket2,s_credit,empshare_sc,s_ec,empshare_ec";
                val = "" + db.str_E(code) + ",'" + bracket1 + "','" + bracket2 + "','" + s_credit + "','" + empshare_sc + "','" + s_ec + "','" + empshare_ec + "'";

                db.DeleteOnTable(table, "code=" + db.str_E(code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "bracket1='" + bracket1 + "',bracket2='" + bracket2 + "',s_credit='" + s_credit + "',empshare_sc='" + empshare_sc + "',s_ec='" + s_ec + "',empshare_ec='" + empshare_ec + "'";

                if (db.UpdateOnTable(table, col, "code=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                goto_win1();
                frm_clear();
                disp_list();
            }
        }
Esempio n. 7
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_contri_remittance";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_month.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            String code  = txt_code.Text;
            String month = txt_code.Text;
            String sbr   = txt_sbr.Text;
            String pbr   = txt_pbr.Text;
            String pr    = txt_pr.Text;

            String sbr_date = dtp_sbr_date.Value.ToString("yyyy-MM-dd");
            String pbr_date = dtp_pbr_date.Value.ToString("yyyy-MM-dd");
            String pr_date  = dtp_pr_date.Value.ToString("yyyy-MM-dd");

            if (isnew)
            {
                col = "crcode,month,sbr,sbr_date,pbr,pbr_date,pr,pr_date";
                val = "" + db.str_E(code) + "," + db.str_E(month) + "," + db.str_E(sbr) + ",'" + sbr_date + "'," + db.str_E(pbr) + ",'" + pbr_date + "'," + db.str_E(pr) + ",'" + pr_date + "'";

                db.DeleteOnTable(table, "crcode=" + db.str_E(code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "crcode=" + db.str_E(code) + ",month=" + db.str_E(month) + ",sbr=" + db.str_E(sbr) + ",pbr=" + db.str_E(pbr) + ",pr=" + db.str_E(pr) + ",sbr_date='" + sbr_date + "',pbr_date='" + pbr_date + "',pr_date='" + pr_date + "'";

                if (db.UpdateOnTable(table, col, "crcode=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                goto_win1();
                frm_clear();
                disp_list();
            }
        }
Esempio n. 8
0
        private void btn_mainsave_Click(object sender, EventArgs e)
        {
            Boolean        success = false;
            String         notificationText = "";
            z_Notification notify = new z_Notification();
            String         loan_code, loan_desc, loan_transdate, loan_location, loan_type, user_id, whs_location_code, loan_amount, deduction_amount, loan_cost_center_code, loan_sub_cost_center, employee_code, employee_name, deduction_date;
            String         cashier = "";
            String         pending = "Y";
            String         col = "", val = "", col2 = "", val2 = "";
            String         notifyadd = null;
            String         table     = "hr_loanhdr";
            String         tableln   = "hr_loanlne";

            //txt_code
            //    txt_desc
            //    cbo_contraacct
            //        cbo_stocklocation
            //        cbo_costcenter
            //            cbo_scc

            if (cbo_contraacct.SelectedIndex == -1)
            {
                MessageBox.Show("No Contract Account Selected");
                cbo_contraacct.DroppedDown = true;
            }
            else if (cbo_stocklocation.SelectedIndex == -1)
            {
                MessageBox.Show("No Stock Location Selected");
                cbo_stocklocation.DroppedDown = true;
            }
            else if (cbo_employee.SelectedIndex == -1)
            {
                MessageBox.Show("No Employee Selected");
                cbo_employee.DroppedDown = true;
            }
            else if (cbo_costcenter.SelectedIndex == -1)
            {
                MessageBox.Show("No Cost Center Selected");
                cbo_costcenter.DroppedDown = true;
            }
            else if (cbo_scc.SelectedIndex == -1)
            {
                MessageBox.Show("No Sub Cost Center Selected");
                cbo_scc.DroppedDown = true;
            }
            else
            {
                loan_code             = txt_code.Text;
                loan_desc             = txt_desc.Text;
                loan_location         = cbo_stocklocation.Text;
                loan_type             = cbo_contraacct.SelectedValue.ToString();
                user_id               = GlobalClass.username;
                whs_location_code     = cbo_stocklocation.Text;
                loan_cost_center_code = cbo_costcenter.Text;
                loan_sub_cost_center  = cbo_scc.Text;
                loan_amount           = txt_amnt_loan.Text;
                deduction_amount      = txt_deduction.Text;
                employee_code         = cbo_employee.SelectedValue.ToString();
                employee_name         = cbo_employee.Text;
                loan_transdate        = dtp_trnxdt.Value.ToString("yyyy-MM-dd");
                deduction_date        = dtp_deduction.Value.ToString("yyyy-MM-dd");
                if (isnew)
                {
                    try
                    {
                        loan_code = db.get_pk("loan_code");
                        col       = "loan_code, loan_desc, loan_location, loan_type, user_id, whs_location_code, loan_cost_center_code,loan_cost_center_name,loan_sub_cost_center,employee_no,employee_name,loan_amount,loan_deduction,loan_transdate,deduction_date";
                        val       = "" + db.str_E(loan_code) + ", " + db.str_E(loan_desc) + ", " + db.str_E(loan_location) + ", " + db.str_E(loan_type) + ", " + db.str_E(user_id) + ", " + db.str_E(whs_location_code) + ", " + db.str_E(loan_cost_center_code) + ", " + db.str_E(loan_cost_center_code) + ", " + db.str_E(loan_sub_cost_center) + ", " + db.str_E(employee_code) + ", " + db.str_E(employee_name) + ", " + db.str_E(loan_amount) + ", " + db.str_E(deduction_amount) + ", " + db.str_E(loan_transdate) + ", " + db.str_E(deduction_date) + "";

                        if (db.InsertOnTable(table, col, val))
                        {
                            db.set_pkm99("loan_code", db.get_nextincrementlimitchar(loan_code, 8));
                            success = true;
                            //add_items(loan_code);
                        }
                        else
                        {
                            db.DeleteOnTable(table, "loan_code=" + db.str_E(loan_code) + "");
                            MessageBox.Show("Failed on saving.");
                        }
                    }
                    catch { }
                }
                else
                {
                    col = "loan_code=" + db.str_E(loan_code) + ", loan_desc=" + db.str_E(loan_desc) + ", loan_location=" + db.str_E(loan_location) + ", loan_type=" + db.str_E(loan_type) + ", user_id=" + db.str_E(user_id) + ", whs_location_code=" + db.str_E(whs_location_code) + ", loan_cost_center_code=" + db.str_E(loan_cost_center_code) + ", loan_cost_center_name=" + db.str_E(loan_cost_center_code) + ", loan_sub_cost_center=" + db.str_E(loan_sub_cost_center) + ", employee_no=" + db.str_E(employee_code) + ", employee_name=" + db.str_E(employee_name) + ", loan_amount=" + db.str_E(loan_amount) + ", loan_deduction=" + db.str_E(deduction_amount) + ", loan_transdate=" + db.str_E(loan_transdate) + ", deduction_date=" + db.str_E(deduction_date) + "";

                    if (db.UpdateOnTable(table, col, "loan_code=" + db.str_E(loan_code) + ""))
                    {
                        //db.DeleteOnTable("soalne", "loan_code='" + loan_code + "'");
                        //add_items(code);

                        success = true;
                    }
                    else
                    {
                        MessageBox.Show("Failed on saving.");
                    }
                }

                if (success)
                {
                    disp_list();
                    goto_tbcntrl_list();
                    tpg_info_enable(false);
                    frm_clear();
                }
            }
        }
Esempio n. 9
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_holidays";


            String date = "", description = "", type = "";

            if (txt_description.Text == "")
            {
                MessageBox.Show("Please enter holiday description.");
                return;
            }
            if (cbo_holiday_type.SelectedIndex == -1)
            {
                MessageBox.Show("Plase select holiday type.");
                cbo_holiday_type.DroppedDown = true;
                return;
            }
            if (txt_id.Text != "")
            {
                id = txt_id.Text;
            }
            date        = dtp_holiday.Value.ToShortDateString();
            description = txt_description.Text;
            type        = cbo_holiday_type.SelectedValue.ToString();

            if (isnew)
            {
                col = "date_holiday,description,holiday_type";
                val = "'" + date + "'," + db.str_E(description) + ",'" + type + "'";


                db.DeleteOnTable(table, "id=" + db.str_E(id) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "id='" + id + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "date_holiday='" + date + "', description=" + db.str_E(description) + ",holiday_type='" + type + "'";

                if (db.UpdateOnTable(table, col, "id=" + db.str_E(id) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                goto_win1();
                disp_list();
                clear_frm();
            }
        }
Esempio n. 10
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null;
            String table     = "hr_depsection";


            String code = "", name = "", deptid = "";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_name.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (cbo_department.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a department.");
                cbo_department.DroppedDown = true;
                return;
            }

            code   = txt_code.Text;
            name   = txt_name.Text;
            deptid = cbo_department.SelectedValue.ToString();

            col = "secid,section_name,deptid";
            val = "" + db.str_E(code) + "," + db.str_E(name) + ",'" + deptid + "'";

            if (isnew)
            {
                db.DeleteOnTable(table, "secid=" + db.str_E(code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "secid='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "secid=" + db.str_E(code) + ", section_name=" + db.str_E(name) + ",deptid='" + deptid + "'";

                if (db.UpdateOnTable(table, col, "secid=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                disp_list();
                goto_win1();
                clear_frm();
            }
        }
Esempio n. 11
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null;
            String table     = "hr_shift_schedule";

            String code = "", am_timein = "", am_timeout = "", pm_timein = "", pm_timeout = "", remarks = "", type = "";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (!chk_am.Checked && !chk_pm.Checked)
            {
                MessageBox.Show("Please enter time in/time out.");
                return;
            }
            if (cbo_type.SelectedIndex == -1)
            {
                MessageBox.Show("Please select type.");
                cbo_type.DroppedDown = true;
                return;
            }

            if (chk_am.Checked)
            {
                am_timein  = dtp_am_in.Value.ToString("HH:mm");
                am_timeout = dtp_am_out.Value.ToString("HH:mm");
            }
            if (chk_pm.Checked)
            {
                pm_timein  = dtp_pm_in.Value.ToString("HH:mm");
                pm_timeout = dtp_pm_out.Value.ToString("HH:mm");
            }


            code    = txt_code.Text;
            remarks = txt_remark.Text;
            type    = cbo_type.Text;

            col = "code,am_timein,am_timeout,pm_timein,pm_timeout,remarks,type";
            val = "" + db.str_E(code) + ",'" + am_timein + "','" + am_timeout + "','" + pm_timein + "','" + pm_timeout + "','" + remarks + "','" + type + "'";

            if (isnew)
            {
                db.DeleteOnTable(table, "code=" + db.str_E(code) + " AND cancel='Y'");// use to replace new data in cancel PK
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "deptid='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "code=" + db.str_E(code) + ",am_timein='" + am_timein + "',am_timeout='" + am_timeout + "',pm_timein='" + pm_timein + "',pm_timeout='" + pm_timeout + "',remarks='" + remarks + "',type='" + type + "'";

                if (db.UpdateOnTable(table, col, "code=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                disp_list();
                goto_win1();
                frm_clear();
            }
        }
Esempio n. 12
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null;
            String table     = "hr_department";


            String code = "", name = "";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_name.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            code = txt_code.Text;
            name = txt_name.Text;

            col = "deptid,dept_name";
            val = "" + db.str_E(code) + "," + db.str_E(name) + "";

            if (isnew)
            {
                db.DeleteOnTable(table, "deptid='" + code + "' AND cancel='Y'");// use to replace new data in cancel PK
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "deptid='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "deptid=" + db.str_E(code) + ", dept_name=" + db.str_E(name) + "";

                if (db.UpdateOnTable(table, col, "deptid=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                disp_list();
                goto_win1();
                frm_clear();
            }
        }
Esempio n. 13
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_leaves";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (cbo_employee.SelectedIndex == -1)
            {
                MessageBox.Show("Please select an employee.");
                cbo_employee.DroppedDown = true;
                return;
            }
            if (cbo_leave_pay.Text == "YES" && gm.toNormalDoubleFormat(txt_amount.Text) == 0)
            {
                MessageBox.Show("Please input leave amount.");
                return;
            }

            String lvcode     = txt_code.Text;
            String no_of_days = Double.Parse(txt_no_of_days.Text).ToString();

            String d_filed      = dtp_filed.Value.ToString("yyyy-MM-dd");
            String leave_from   = dtp_lfrm.Value.ToString("yyyy-MM-dd");
            String leave_to     = dtp_lto.Value.ToString("yyyy-MM-dd");
            String leave_amount = txt_amount.Text;
            String empid        = (cbo_employee.SelectedValue ?? "").ToString();
            String leave_pay    = cbo_leave_pay.Text;
            String leave_type   = (cbo_leave.SelectedValue ?? "").ToString();

            String frm_am = Convert.ToString(chk_fam.Checked);
            String frm_pm = Convert.ToString(chk_fpm.Checked);
            String to_am  = Convert.ToString(chk_tam.Checked);
            String to_pm  = Convert.ToString(chk_tpm.Checked);

            // hr_leaves, lvcode, empid, d_filed, leave_from, leave_to, frm_am, frm_pm, to_am, to_pm, no_of_days, leave_pay, leave_type
            if (isnew)
            {
                col = "lvcode, empid, d_filed, leave_from, leave_to, frm_am, frm_pm, to_am, to_pm, no_of_days, leave_pay, leave_type, leave_amount";
                val = "'" + lvcode + "', '" + empid + "', '" + d_filed + "', '" + leave_from + "', '" + leave_to + "', '" + frm_am + "', '" + frm_pm + "', '" + to_am + "', '" + to_pm + "', '" + no_of_days + "', '" + leave_pay + "', '" + leave_type + "', '" + leave_amount + "'";

                db.DeleteOnTable(table, "lvcode='" + lvcode + "' AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "empid='" + empid + "', d_filed='" + d_filed + "', leave_from='" + leave_from + "', leave_to='" + leave_to + "', frm_am='" + frm_am + "', frm_pm='" + frm_pm + "', to_am='" + to_am + "', to_pm='" + to_pm + "', no_of_days='" + no_of_days + "', leave_pay='" + leave_pay + "', leave_type='" + leave_type + "', leave_amount='" + leave_amount + "'";
                if (db.UpdateOnTable(table, col, "lvcode='" + lvcode + "'"))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }
            if (success)
            {
                goto_win1();
                frm_clear();
                disp_list();
            }
        }
Esempio n. 14
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean success = false, ok = false;
            String notificationText = "";
            z_Notification notify = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_leave_type";

            String code = "", description = "";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return; 
            }
            if(String.IsNullOrEmpty(txt_description.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return; 
            }

            code = txt_code.Text;
            description = txt_description.Text;

            if(isnew)
            {
                col = "code,description";
                val = "" + db.str_E(code) + "," + db.str_E(description) + "";

                db.DeleteOnTable(table, "code=" + db.str_E(code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "description=" + db.str_E(description) + "";
                if (db.UpdateOnTable(table, col, "code=" + db.str_E(code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }
            if(success)
            {
                goto_win1();
                ClearForm();
                disp_list();
                
            }
        }
Esempio n. 15
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_business_unit";

            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_desc.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            String bucode            = txt_code.Text;
            String bunit_desc        = txt_desc.Text;
            String bank_disburse     = txt_bank_disburse.Text;
            String bank_addr         = txt_bank_addr.Text;
            String accnt_no          = txt_accnt_no.Text;
            String contact_person    = txt_contact_person.Text;
            String designation_cp    = txt_designation_cp.Text;
            String bletter_prepared  = txt_bletter_prepared.Text;
            String designation_blp   = txt_designation_blp.Text;
            String bletter_noted     = txt_bletter_noted.Text;
            String designation_bln   = txt_designation_bln.Text;
            String accnt_data_folder = txt_accnt_data_folder.Text;
            String letter_format     = cbo_letter_format.Text;

            if (isnew)
            {
                col = "bucode,bunit_desc,bank_disburse,bank_addr,accnt_no,contact_person,designation_cp, bletter_prepared ,designation_blp,bletter_noted,designation_bln,accnt_data_folder,letter_format";
                //val = "'" + code + "','" + bracket1 + "','" + bracket2 + "','" + s_credit + "','" + empshare_sc + "','" + s_ec + "','" + empshare_ec + "'";
                val = "" + db.str_E(bucode) + "," + db.str_E(bunit_desc) + "," + db.str_E(bank_disburse) + "," + db.str_E(bank_addr) + "," + db.str_E(accnt_no) + "," + db.str_E(contact_person) + "," + db.str_E(designation_cp) + ", " + db.str_E(bletter_prepared) + "," + db.str_E(designation_blp) + "," + db.str_E(bletter_noted) + "," + db.str_E(designation_bln) + "," + db.str_E(accnt_data_folder) + "," + db.str_E(letter_format) + "";


                db.DeleteOnTable(table, "bucode=" + db.str_E(bucode) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "code='" + code + "'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "bunit_desc=" + db.str_E(bunit_desc) + ",bank_disburse=" + db.str_E(bank_disburse) + ",bank_addr=" + db.str_E(bank_addr) + ",accnt_no=" + db.str_E(accnt_no) + ",contact_person=" + db.str_E(contact_person) + ",designation_cp=" + db.str_E(designation_cp) + ", bletter_prepared=" + db.str_E(bletter_prepared) + ",designation_blp=" + db.str_E(designation_blp) + ",bletter_noted=" + db.str_E(bletter_noted) + ",designation_bln=" + db.str_E(designation_bln) + ",accnt_data_folder=" + db.str_E(accnt_data_folder) + ",letter_format=" + db.str_E(letter_format) + "";

                if (db.UpdateOnTable(table, col, "bucode=" + db.str_E(bucode) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                goto_win1();
                frm_clear();
                disp_list();
            }
        }
Esempio n. 16
0
        private void btn_save_Click_1(object sender, EventArgs e)
        {
            Boolean        success = false, ok = false;
            String         notificationText = "";
            z_Notification notify           = new z_Notification();

            String branch = GlobalClass.branch;
            String col = "", val = "";
            String notifyadd = null, id = "";
            String table = "hr_payrollpariod";

            String pay_code = "", date_from = "", date_to = "", d_w_tax = "", d_sss_c = "", d_philhealth = "", d_pagibig = "", financial_year = "", month = "", pay_type = "", num_days = "", payroll_classic = "";


            if (String.IsNullOrEmpty(txt_code.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_f_year.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_f_month.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }
            if (String.IsNullOrEmpty(txt_num_days.Text))
            {
                MessageBox.Show("Please enter the required fields.");
                return;
            }

            /*
             * if(cbo_payroll_classic.SelectedIndex == -1)
             * {
             *  MessageBox.Show("Please select payroll classification.");
             *  return;
             * }
             */
            if (cbo_dw_tax.SelectedIndex == 0)
            {
                d_w_tax = "Y";
            }
            else
            {
                d_w_tax = "N";
            }
            if (cbo_d_sss_c.SelectedIndex == 0)
            {
                d_sss_c = "Y";
            }
            else
            {
                d_sss_c = "N";
            }
            if (cbo_d_phil.SelectedIndex == 0)
            {
                d_philhealth = "Y";
            }
            else
            {
                d_philhealth = "N";
            }
            if (cbo_pagibig.SelectedIndex == 0)
            {
                d_pagibig = "Y";
            }
            else
            {
                d_pagibig = "N";
            }
            if (cbo_p_type.SelectedIndex == 0)
            {
                pay_type = "S";
            }
            else
            {
                pay_type = "R";
            }

            pay_code       = txt_code.Text;
            date_from      = dtp_from.Value.ToShortDateString();
            date_to        = dtp_to.Value.ToShortDateString();
            financial_year = txt_f_year.Text;
            num_days       = txt_num_days.Text;
            month          = txt_f_month.Text;
            if (String.IsNullOrEmpty(month))
            {
                month = DateTime.Now.ToString("MM");
            }
            if (cbo_payroll_classic.SelectedIndex != -1)
            {
                payroll_classic = cbo_payroll_classic.SelectedValue.ToString();
            }


            if (isnew)
            {
                col = "pay_code,date_from,date_to,d_w_tax,d_sss_c ,d_philhealth,d_pagibig,financial_year,month,pay_type,num_days,payroll_classic";
                val = "" + db.str_E(pay_code) + ",'" + date_from + "','" + date_to + "','" + d_w_tax + "','" + d_sss_c + "','" + d_philhealth + "','" + d_pagibig + "','" + financial_year + "','" + month + "','" + pay_type + "','" + num_days + "','" + payroll_classic + "'";

                db.DeleteOnTable(table, "pay_code=" + db.str_E(pay_code) + " AND cancel='Y'");
                if (db.InsertOnTable(table, col, val))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    //db.DeleteOnTable(table, "pay_code='" + pay_code +"'");
                    MessageBox.Show("Failed on saving.");
                }
            }
            else
            {
                col = "date_from='" + date_from + "',date_to='" + date_to + "',d_w_tax='" + d_w_tax + "',d_sss_c='" + d_sss_c + "',d_philhealth='" + d_philhealth + "',d_pagibig='" + d_pagibig + "',financial_year='" + financial_year + "',month='" + month + "',pay_type='" + pay_type + "',num_days='" + num_days + "',payroll_classic='" + payroll_classic + "'";
                if (db.UpdateOnTable(table, col, "pay_code=" + db.str_E(pay_code) + ""))
                {
                    success = true;
                }
                else
                {
                    success = false;
                    MessageBox.Show("Failed on saving.");
                }
            }

            if (success)
            {
                goto_win1();
                disp_list();
            }
        }