Example #1
0
        public void InitializeBinding()
        {
            lt = SqlliteDataAccess.LoadType();
            dgvhokm.DataSource = lt;

            dgvhokm.Columns[0].Visible    = false;
            dgvhokm.Columns[1].HeaderText = "نام";
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TypeSalaryModel t = new TypeSalaryModel();

            t.Name = txtname.Text;
            SqlliteDataAccess.SaveType(t);
            FMessageBox.Show("با موفقیت ذخیره شد", "پیام");
            InitializeBinding();
        }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            TypeSalaryModel t = new TypeSalaryModel();

            t.ID = Convert.ToInt32(dgvhokm.CurrentRow.Cells[0].Value);
            SqlliteDataAccess.DeleteType(t);
            FMessageBox.Show("با موفقیت حذف شد", "پیام");
            txtname.ResetText();
            InitializeBinding();
        }
Example #4
0
        public void LoadEducation()
        {
            List <EducationModel> e = new List <EducationModel>();

            e = SqlliteDataAccess.LoadEducation();

            cmbEducation.DataSource    = e;
            cmbEducation.DisplayMember = "Name";
            //cmbEducation.SelectedValue = "Code";
        }
Example #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            HokmModel h = new HokmModel();

            h.ID = Convert.ToInt32(dgvhokm.CurrentRow.Cells[0].Value.ToString());

            SqlliteDataAccess.DeleteHokm(h);
            FMessageBox.Show("با موفقیت حذف شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information);

            InitializeBinding();
        }
Example #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            HokmModel h = new HokmModel();

            h.Name     = txtname.Text;
            h.Price    = Convert.ToInt32(txtprice.Text);
            h.PersonID = p.ID;

            SqlliteDataAccess.SaveHokm(h);
            InitializeBinding();
        }
Example #7
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            if (dgvperson.CurrentRow.Cells[0].Value != null)
            {
                PersonModel pe = new PersonModel();

                pe.ID
                    = Convert.ToInt32(dgvperson.CurrentRow.Cells[0].Value.ToString());
                SqlliteDataAccess.DeletePerson(pe);
                FMessageBox.Show("با موفقیت حذف شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information);
                InitializeBinding();
            }
        }
Example #8
0
        private void txtcity_TextChanged(object sender, EventArgs e)
        {
            try
            {
                search = txtcity.Text;

                Frmcity            = SqlliteDataAccess.LoadCity(search, type);
                dgvcity.DataSource = Frmcity;
            }
            catch (Exception ex)
            {
                FMessageBox.Show(ex.Message, "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Warning);
            }
        }
Example #9
0
        private void LoadCity()
        {
            try
            {
                Frmcity = SqlliteDataAccess.LoadCity();

                dgvcity.DataSource = Frmcity;
                dgvcity.Columns["Code"].HeaderText = "کد";
                dgvcity.Columns["Name"].HeaderText = "نام گروه";
            }
            catch (Exception ex)
            {
                FMessageBox.Show(ex.Message, "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Warning);
            }
        }
Example #10
0
        public void InitializeBinding()
        {
            lpm = SqlliteDataAccess.LoadPerson();
            dgvperson.DataSource = lpm;

            dgvperson.Columns["Name"].HeaderText         = "نام";
            dgvperson.Columns["FatherName"].HeaderText   = "نام پدر";
            dgvperson.Columns["NationalCode"].HeaderText = "کد ملی";
            dgvperson.Columns["Family"].HeaderText       = " نام خانوادگی";
            dgvperson.Columns["Tell"].HeaderText         = " تلفن ";
            dgvperson.Columns["Mobile"].HeaderText       = " موبایل ";

            dgvperson.Columns["ID"].Visible                 = false;
            dgvperson.Columns["BimeNum"].Visible            = false;
            dgvperson.Columns["EmpCode"].Visible            = false;
            dgvperson.Columns["EmpShSh"].Visible            = false;
            dgvperson.Columns["EmpMSh1"].Visible            = false;
            dgvperson.Columns["EmpMSh2"].Visible            = false;
            dgvperson.Columns["CitySodor"].Visible          = false;
            dgvperson.Columns["BakhshSodor"].Visible        = false;
            dgvperson.Columns["CityTavalod"].Visible        = false;
            dgvperson.Columns["CityCodeSodor"].Visible      = false;
            dgvperson.Columns["CityTavalodCode"].Visible    = false;
            dgvperson.Columns["CountryTavalod"].Visible     = false;
            dgvperson.Columns["CountryTavalodCode"].Visible = false;
            dgvperson.Columns["Job"].Visible                = false;
            dgvperson.Columns["JobCode"].Visible            = false;
            dgvperson.Columns["Sex"].Visible                = false;
            dgvperson.Columns["Married"].Visible            = false;
            dgvperson.Columns["Child"].Visible              = false;
            dgvperson.Columns["National"].Visible           = false;
            dgvperson.Columns["Education"].Visible          = false;
            dgvperson.Columns["Branch"].Visible             = false;
            dgvperson.Columns["UniverCity"].Visible         = false;
            dgvperson.Columns["YearEducation"].Visible      = false;
            dgvperson.Columns["CodeTell"].Visible           = false;
            dgvperson.Columns["Email"].Visible              = false;
            dgvperson.Columns["Address"].Visible            = false;
            dgvperson.Columns["Post"].Visible               = false;
            dgvperson.Columns["JobNum"].Visible             = false;
            dgvperson.Columns["JobDate"].Visible            = false;
            dgvperson.Columns["BankName"].Visible           = false;
            dgvperson.Columns["Banknum"].Visible            = false;
            dgvperson.Columns["BankCard"].Visible           = false;
            dgvperson.Columns["Pic"].Visible                = false;
            dgvperson.Columns["Doc"].Visible                = false;
            dgvperson.Columns["TavalodDate"].Visible        = false;
        }
Example #11
0
        public void InitializeBinding()
        {
            List <HokmModel> h = new List <HokmModel>();


            h = SqlliteDataAccess.LoadHokme();

            dgvhokm.DataSource = h.Where(x => x.PersonID == p.ID).ToList();



            dgvhokm.Columns["ID"].Visible       = false;
            dgvhokm.Columns["PersonID"].Visible = false;
            dgvhokm.Columns["Name"].HeaderText  = "نام";
            dgvhokm.Columns["Price"].HeaderText = "مبلغ";


            st  = SqlliteDataAccess.LoadType();
            arr = new string[st.Count];
            for (int i = 0; i < st.Count; i++)
            {
                arr[i] = st[i].Name.ToString();
            }
        }
Example #12
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            //try
            //{

            PersonModel p = new PersonModel();

            p.Name               = txtname.Text;
            p.Family             = txtfamily.Text;
            p.BimeNum            = txtbimenum.Text;       //3
            p.EmpCode            = txtempcode.Text;       //4
            p.FatherName         = txtfathername.Text;    //5
            p.NationalCode       = txtnationalcode.Text;  //6
            p.EmpShSh            = txtshsh.Text;          //7
            p.EmpMSh1            = txtmsh1.Text;          //8
            p.EmpMSh2            = txtmsh2.Text;          //9
            p.CitySodor          = txtcitysodor.Text;     //10
            p.CityCodeSodor      = txtcodecitysodor.Text; //11
            p.BakhshSodor        = txtbakhshsodor.Text;   //12
            p.CityTavalod        = txtcitytavalod.Text;   //13
            p.CityTavalodCode    = txtcodetavalod.Text;   //14
            p.CountryTavalod     = txtcountry.Text;       //15
            p.CountryTavalodCode = txtcodecountry.Text;   //16
            //p.TavalodDate = Convert.ToInt32(txttavaloddate.Text.Replace("/",""));  //17
            p.Job     = txtjobname.Text;                  //18
            p.JobCode = txtjobcode.Text;                  //19
            //p.Sex = cmbSex.SelectedItem.ToString();     //20
            //p.Married = cmbMarrid.SelectedItem.ToString();  //21
            p.Child = txtchild.Value.ToString();                  //22
            //p.National = cmbNation.SelectedItem.ToString();     //23
            p.Education  = cmbEducation.SelectedValue.ToString(); //FMessageBox.Show(cmbEducation.SelectedValue.ToString());    //24
            p.Branch     = txtbranch.Text;                        //25
            p.UniverCity = txtunivercity.Text;                    //26
            //p.YearEducation = Convert.ToInt32(txtyear.Text);       //27
            p.Tell     = txttell.Text;                            //28
            p.CodeTell = txttellcode.Text;                        //29
            p.Mobile   = txtmobile.Text;                          //30


            try
            {
                //var eMailValidator = new System.Net.Mail.MailAddress(txtemail.Text);
                //p.Email = eMailValidator.ToString();
            }
            catch (FormatException ex)
            {
                FMessageBox.Show("آدرس ایمیل درست وارد کنید");
                return;
            }

            p.Address = txtaddress.Text;        //32
            p.Post    = txtpost.Text;           //33
            p.JobNum  = txtjobnum.Text;         //34
            //p.JobDate = Convert.ToInt32(txtjobdate.Text.Replace("/", ""));  //35
            p.BankName = txtbankname.Text;      //36
            p.Banknum  = txtbanknum.Text;       //37
            p.BankCard = txtbankcard.Text;      //38
            p.Pic      = pic;                   //39


            if (btnsave.Text == "ویرایش")
            {
                p.ID = ID;
                SqlliteDataAccess.EditPerson(p);
                FMessageBox.Show("با موفقیت ویرایش شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information);
            }
            else
            {
                SqlliteDataAccess.SavePerson(p);
                FMessageBox.Show("با موفقیت ثبت شد", "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Information);
            }
            FrmViewEmp vm = new FrmViewEmp();

            vm.InitializeBinding();

            this.Close();


            //}
            //catch (Exception ex)
            //{

            //    FMessageBox.Show(ex.Message, "پیام", FMessageBoxButtons.OK, FMessageBoxIcons.Warning);

            //}
        }