Beispiel #1
0
        public Worker_Frm()
        {
            InitializeComponent();
            //......Set Mask For ElEntryBox (string)
            elEntryBox2.ValidationStyle = _PublicClass.Mask_Format_String();//......Name EntryBox
            elEntryBox3.ValidationStyle = _PublicClass.Mask_Format_String();//......Family Entry Box
            elEntryBox4.ValidationStyle = _PublicClass.Mask_Format_String();//......Father Name Entry Box

            //......Set Mask For ElEntryBox (Number)
            elEntryBox5.ValidationStyle = _PublicClass.Mask_Format_Style("0000000000");//......N_code
            elEntryBox6.ValidationStyle = _PublicClass.Mask_Format_Style("0000000000");

            //bithday date
            elEntryBox7.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //address
            elEntryBox15.ValidationStyle = _PublicClass.Mask_Format_String_Address();
            //mobile number
            elEntryBox17.ValidationStyle = _PublicClass.Mask_Format_Style("\\0\\9000000000");
            //data of pay salary
            elEntryBox19.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //start job
            elEntryBox21.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //end job
            elEntryBox22.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();

            //......Fill Education List.......
            foreach (DataRow EDU in _PublicClass.EducationCombobox().Rows)
            {
                ELListBoxItem ellist = new ELListBoxItem();
                ellist.Key = EDU[0];
                ellist.Value = EDU[1];
                elEntryBox10.Items.Add(ellist);
            }
            //......Fill Religion ListBox
            foreach(DataRow Religion in _PublicClass.Religion_pri().Rows)
            {
                ELListBoxItem Ellist = new ELListBoxItem();
                Ellist.Key = Religion[0];
                Ellist.Value = Religion[1];
                elEntryBox11.Items.Add(Ellist);
            }

            //.....Fill United ListBox
            foreach(DataRow United in _PublicClass.United().Rows)
            {
                ELListBoxItem ellist = new ELListBoxItem();
                ellist.Key = United[0];
                ellist.Value = United[1];

                elEntryBox13.Items.Add(ellist);
            }
        }
Beispiel #2
0
 // enter sub city to combobox
 private void united_combo_SelectedIndexChanged(object sender, EventArgs e)
 {
     city_combo.Items.Clear();
     city_combo.Items.Add("");
     if (united_combo.SelectedIndex > 0)
     {
         foreach (DataRow item in _PublicClass.City(((int)united_combo.SelectedKey)).Rows)
         {
             ELListBoxItem NewItem = new ELListBoxItem();
             NewItem.Key = item[0];
             NewItem.Value = item[1];
             city_combo.Items.Add(NewItem);
         }
     }
 }
Beispiel #3
0
 // enter sub religion to combobox
 private void religion_pri_combo_SelectedIndexChanged(object sender, EventArgs e)
 {
     religion_sec_combo.Items.Clear();
     foreach (DataRow item in _PublicClass.Religion_sec(((int)religion_pri_combo.SelectedKey)).Rows)
     {
         ELListBoxItem NewItem = new ELListBoxItem();
         NewItem.Key = item[0];
         NewItem.Value = item[1];
         religion_sec_combo.Items.Add(NewItem);
     }
 }
Beispiel #4
0
        //when user click on first column then show all of clerk information
        private void DataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0 && DataGridView1.Rows.Count >0)
            {
                DataTable dt = _DA.Do_Table(_DA.Do_Sql_Adapter("SELECT * FROM clerk WHERE code=" + DataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString().Trim()));
                foreach (Control item in elRichPanel7.Controls)
                {
                    if (item is ELEntryBox)
                    {
                        if ((item as ELEntryBox).Tag.ToString() != "")
                        {
                            (item as ELEntryBox).Value = dt.Rows[0][(item as ELEntryBox).Tag.ToString()].ToString().Trim();
                        }
                    }
                }
                elEntryBox21.Value = elEntryBox21.Value.ToString().Remove(elEntryBox21.Value.ToString().Length - 3, 3);
                elEntryBox22.Value = elEntryBox22.Value.ToString().Remove(elEntryBox22.Value.ToString().Length - 3, 3);
                BLL.picture pic = new BLL.picture();
                pictureBox1.Image = pic.GettingPicture(elEntryBox1.Value.ToString());
                if (pictureBox1.Image == null) { pictureBox1.Image = Almas.Properties.Resources.user; }

                elRadioButton2.Checked = bool.Parse(dt.Rows[0]["sex"].ToString()) == false ? true : false;
                elRadioButton3.Checked = bool.Parse(dt.Rows[0]["sex"].ToString()) == true ? true : false;
                elCheckBox1.Checked = bool.Parse(dt.Rows[0]["insurance"].ToString());
                elEntryBox8.Value = (dt.Rows[0]["relation"].ToString() == "True") ? "متاهل" : "مجرد";
                elEntryBox9.Value = (dt.Rows[0]["military"].ToString() == "True") ? "دارای کارت پایان خدمت" : "بدون کارت پایان خدمت";
                elEntryBox7.Value = DateTime.Parse(dt.Rows[0]["birth_date"].ToString()).ToShortDateString();
                elEntryBox10.Value = _DA.Do_Table(_DA.Do_Sql_Adapter("Select name from education where ID =" + dt.Rows[0]["education"].ToString().Trim())).Rows[0]["name"].ToString();
                elEntryBox11.Value = _DA.Do_Table(_DA.Do_Sql_Adapter("Select name from religion_pri where ID =" + dt.Rows[0]["religion_pri"].ToString().Trim())).Rows[0]["name"].ToString();
                elEntryBox12.Value = _DA.Do_Table(_DA.Do_Sql_Adapter("Select name from religion_sec where ID =" + dt.Rows[0]["religion_sec"].ToString().Trim())).Rows[0]["name"].ToString();
                elEntryBox13.Value = _DA.Do_Table(_DA.Do_Sql_Adapter("Select name from united where ID =" + dt.Rows[0]["united"].ToString().Trim())).Rows[0]["name"].ToString();
                elEntryBox14.Value = _DA.Do_Table(_DA.Do_Sql_Adapter("Select name from city where ID =" + dt.Rows[0]["city"].ToString().Trim())).Rows[0]["name"].ToString();
                string illnessFromDB = dt.Rows[0]["illness"].ToString().Remove(0,1);
                int[] illness_num = new int[(illnessFromDB.Length / 3)];

                for (int i = 0; illnessFromDB.Length > 1; i++)
                {
                    illness_num[i] = int.Parse(illnessFromDB.Substring(0, illnessFromDB.IndexOf(",,")).ToString()) ;
                    illnessFromDB = illnessFromDB.Remove(0, illnessFromDB.IndexOf(",,") + 2);
                }

                elEntryBox23.Items.Clear();
                foreach (DataRow item in _PublicClass.Illness().Rows)
                {
                    ELListBoxItem ExItem = new ELListBoxItem();
                    ExItem.Key = item[0];
                    ExItem.Value = item[1];
                    foreach (int item_key in illness_num)
                    {
                        if (item_key == int.Parse(item[0].ToString()))
                        {
                            ExItem.CheckState = CheckState.Checked;
                        }
                    }
                    elEntryBox23.Items.Add(ExItem);
                }

                Modal1.Show(this, elRichPanel7);
            }
        }
Beispiel #5
0
        public Clerk_Show()
        {
            InitializeComponent();
            // this wrote for time_picker_ Click event
            time_picker1.TimePickerClicked += OnButtonsClicked;
            //fill DataGridView and write Qty of row
            DataGridView1.AutoGenerateColumns = false;
            DataGridView1.DataSource = _DA.Do_Table(_DA.Do_Sql_Adapter("SELECT * FROM clerk"));
            elLabel1.Text = "تعداد سطرها :" + "     " + DataGridView1.Rows.Count.ToString();
            //---------

            //set read only for enterybox in richpanel4 // for date value
            foreach (Control item in elRichPanel4.Controls)
            {
                if (item is ELEntryBox)
                {
                    (item as ELEntryBox).ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
                }
            }
            //set read only for enterybox in richpanel5 // for date value
            foreach (Control item in elRichPanel5.Controls)
            {
                if (item is ELEntryBox)
                {
                    (item as ELEntryBox).ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
                }
            }

            // add information of education on combobox
            education_combo.Items.Add("");
            foreach (DataRow item in _PublicClass.EducationCombobox().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                education_combo.Items.Add(ExItem);
            }
            // add information of religion on combobox
            religion_pri_combo.Items.Add("");
            foreach (DataRow item in _PublicClass.Religion_pri().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                religion_pri_combo.Items.Add(ExItem);
            }
            // add information of uniteds on combobox
            united_combo.Items.Add("");
            foreach (DataRow item in _PublicClass.United().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                united_combo.Items.Add(ExItem);
            }
            // add information of illness on combobox
            foreach (DataRow item in _PublicClass.Illness().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                illness_combo.Items.Add(ExItem);
            }

            //set mask to special entrybox
            //personalization code
            personal_code_txt.ValidationStyle = _PublicClass.Mask_Format_Style("000000");
            //nation code
            nCode_txt.ValidationStyle = _PublicClass.Mask_Format_Style("0000000000");
            //shenasname code
            sh_sh_txt.ValidationStyle = _PublicClass.Mask_Format_Style("0000000000");
            //bithday date
            birth_txt.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //address
            address_txt.ValidationStyle = _PublicClass.Mask_Format_String_Address();
            //mobile number
            mobile_txt.ValidationStyle = _PublicClass.Mask_Format_Style("\\0\\9000000000");
            //data of pay salary
            pay_time_txt.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //start job
            start_work_txt.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //end job
            end_work_txt.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();

            //set string mask for all of string entrybox
            name_txt.ValidationStyle = _PublicClass.Mask_Format_String();
            family_txt.ValidationStyle = _PublicClass.Mask_Format_String();
            father_txt.ValidationStyle = _PublicClass.Mask_Format_String();
            salary_txt.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            overtime_txt.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();

            //set readonly mask for all enterybox in richbox7 because they are just for show info
            elRadioButton2.Enabled = false;
            elRadioButton3.Enabled = false;
            elCheckBox1.Enabled = false;
            foreach (Control item in elRichPanel7.Controls)
            {
                if (item is ELEntryBox)
                {
                    (item as ELEntryBox).ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
                }
            }
        }
Beispiel #6
0
        public Clerk()
        {
            InitializeComponent();
            time_picker1.TimePickerClicked += OnButtonsClicked;

            // add information of education on combobox
            foreach (DataRow item in _PublicClass.EducationCombobox().Rows)
            {
                    ELListBoxItem ExItem = new ELListBoxItem();
                    ExItem.Key = item[0];
                    ExItem.Value = item[1];
                    elEntryBox10.Items.Add(ExItem);
            }
            // add information of religion on combobox
            foreach (DataRow item in _PublicClass.Religion_pri().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                elEntryBox11.Items.Add(ExItem);
            }
            // add information of uniteds on combobox
            foreach (DataRow item in _PublicClass.United().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                elEntryBox13.Items.Add(ExItem);
            }
            // add information of illness on combobox
            foreach (DataRow item in _PublicClass.Illness().Rows)
            {
                ELListBoxItem ExItem = new ELListBoxItem();
                ExItem.Key = item[0];
                ExItem.Value = item[1];
                elEntryBox23.Items.Add(ExItem);
            }
            //set mask to special entrybox
            //personalization code
            elEntryBox1.ValidationStyle = _PublicClass.Mask_Format_Style("000000");
            //nation code
            elEntryBox5.ValidationStyle = _PublicClass.Mask_Format_Style("0000000000");
            //shenasname code
            elEntryBox6.ValidationStyle = _PublicClass.Mask_Format_Style("0000000000");
            //bithday date
            elEntryBox7.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //address
            elEntryBox15.ValidationStyle = _PublicClass.Mask_Format_String_Address();
            //mobile number
            elEntryBox17.ValidationStyle = _PublicClass.Mask_Format_Style("\\0\\9000000000");
            //data of pay salary
            elEntryBox19.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //start job
            elEntryBox21.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();
            //end job
            elEntryBox22.ValidationStyle = _PublicClass.Mask_Format_ReadOnly();

            //set string mask for all of string entrybox
            elEntryBox2.ValidationStyle = _PublicClass.Mask_Format_String();
            elEntryBox3.ValidationStyle = _PublicClass.Mask_Format_String();
            elEntryBox4.ValidationStyle = _PublicClass.Mask_Format_String();
        }
Beispiel #7
0
 //when user choose a united this Function fill city sub data in city combobox
 private void elEntryBox13_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (elEntryBox13.SelectedIndex != -1)
     {
         elEntryBox14.Items.Clear();
         foreach (DataRow item in _PublicClass.City((int.Parse(elEntryBox13.SelectedKey.ToString()))).Rows)
         {
             ELListBoxItem NewItem = new ELListBoxItem();
             NewItem.Key = item[0];
             NewItem.Value = item[1];
             elEntryBox14.Items.Add(NewItem);
         }
         elEntryBox14.SelectedIndex = 0;
     }
 }
Beispiel #8
0
 //}
 //when user choose a religion_pri this Function fill religion sub data in religion_sec combobox
 private void elEntryBox11_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (elEntryBox11.SelectedKey != null)
     {
         elEntryBox12.Items.Clear();
         foreach (DataRow item in _PublicClass.Religion_sec(((int)elEntryBox11.SelectedKey)).Rows)
         {
             ELListBoxItem NewItem = new ELListBoxItem();
             NewItem.Key = item[0];
             NewItem.Value = item[1];
             elEntryBox12.Items.Add(NewItem);
         }
         elEntryBox12.SelectedIndex = 0;
     }
 }
Beispiel #9
0
 private void elEntryBox13_SelectedIndexChanged(object sender, EventArgs e)
 {
     elEntryBox14.Items.Clear();
     foreach (DataRow City in _PublicClass.City(int.Parse(elEntryBox13.SelectedKey.ToString())).Rows)
     {
         ELListBoxItem ellist = new ELListBoxItem();
         ellist.Key = City[0];
         ellist.Value = City[1];
         elEntryBox14.Items.Add(ellist);
     }
     elEntryBox14.SelectedIndex= 0;
 }
Beispiel #10
0
 private void elEntryBox11_SelectedIndexChanged(object sender, EventArgs e)
 {
     //......Fill Religion_Sec
     elEntryBox12.Items.Clear();
     foreach(DataRow religion in _PublicClass.Religion_sec(int.Parse(elEntryBox11.SelectedKey.ToString())).Rows)
     {
         ELListBoxItem ellist = new ELListBoxItem();
         ellist.Key = religion[0];
         ellist.Value = religion[1];
         elEntryBox12.Items.Add(ellist);
     }
     elEntryBox12.SelectedIndex = 0;
 }