Пример #1
0
        private void label1_Click(object sender, EventArgs e)
        {
            Form9_money_sarmaye form = new Form9_money_sarmaye();

            form.Show();
            this.Hide();
        }
Пример #2
0
        private void label7_Click(object sender, EventArgs e)
        {
            Model.sarmaye model = new Model.sarmaye()
            {
                count        = Int32.Parse(count.Text),
                creatoreCo   = Ctitle.Text,
                title        = title.Text,
                kollPD       = Int32.Parse(koldollary.Text),
                kollPR       = Int32.Parse(kolrially.Text),
                vahedPD      = Int32.Parse(vaheddollary.Text),
                vahedPR      = Int32.Parse(vahedrially.Text),
                shenasnameID = GlobalVariable.shenasnameID,
            };
            dbcontext.sarmayes.Add(model);
            dbcontext.SaveChanges();
            int index = 0;

            foreach (Form form in Application.OpenForms)
            {
                if (form.Name == "Form9_money_sarmaye")
                {
                    break;
                }

                index += 1;
            }
            this.Hide();

            Application.OpenForms[index].Close();
            Form9_money_sarmaye form9 = new Form9_money_sarmaye();

            form9.Show();
        }
Пример #3
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            using (var dbcontext = new Model.Context())
            {
                Model.shenasname item = dbcontext.shenasnames.Where(x => x.ID == GlobalVariable.shenasnameID).FirstOrDefault();
                if (item.final != 1)
                {
                    int iSelectedGridIndex = dataGridView1.CurrentCell.ColumnIndex;
                    if (iSelectedGridIndex != 0)
                    {
                        return;
                    }
                    int    rowindex = dataGridView1.CurrentCell.RowIndex;
                    string rowID    = dataGridView1.Rows[rowindex].Cells[2].Value.ToString();

                    Model.sarmaye model = dbcontext.sarmayes.SingleOrDefault(x => x.title == rowID && x.shenasnameID == GlobalVariable.shenasnameID);
                    dbcontext.Entry(model).State = EntityState.Deleted;
                    dbcontext.SaveChanges();
                    int index = 0;
                    foreach (Form form in Application.OpenForms)
                    {
                        if (form.Name == "Form9_money_sarmaye")
                        {
                            break;
                        }

                        index += 1;
                    }
                    this.Hide();

                    Application.OpenForms[index - 1].Close();
                    Form9_money_sarmaye form9 = new Form9_money_sarmaye();
                    form9.Show();
                }
            }
        }
Пример #4
0
        private void label18_Click(object sender, EventArgs e)
        {
            string id = GlobalVariable.shenasnameID;

            Model.shenasname item = dbcontext.shenasnames.FirstOrDefault(x => x.ID == id);
            if (item.final != 1)
            {
                try
                {
                    item.DrasmiT         = Int32.Parse(DrasmiT.Text);
                    item.DrasmiHPR       = Int32.Parse(DrasmiHPR.Text);
                    item.DrasmiHPD       = Int32.Parse(DrasmiHPD.Text);
                    item.DgharartamamT   = Int32.Parse(DgharartamamT.Text);
                    item.DgharartamamHPR = Int32.Parse(DgharartamamHPR.Text);
                    item.DgharartamamHPD = Int32.Parse(DgharartamamHPD.Text);
                    item.DghararsaatT    = Int32.Parse(DghararsaatT.Text);
                    item.DghararsaatHPR  = Int32.Parse(DghararsaatHPR.Text);
                    item.DghararsaatHPD  = Int32.Parse(DghararsaatHPD.Text);
                    item.DvazifeT        = Int32.Parse(DvazifeT.Text);
                    item.DvazifeHPR      = Int32.Parse(DvazifeHPR.Text);
                    item.DvazifeHPD      = Int32.Parse(DvazifeHPD.Text);

                    item.ZDirasmiT         = Int32.Parse(ZDirasmiT.Text);
                    item.ZDirasmiHPR       = Int32.Parse(ZDirasmiTHPR.Text != "" ? ZDirasmiTHPR.Text : "0");
                    item.ZDirasmiHPD       = Int32.Parse(ZDirasmiHPD.Text);
                    item.ZDigharartamamT   = Int32.Parse(ZDigharartamamT.Text);
                    item.ZDigharartamamHPR = Int32.Parse(ZDigharartamamHPR.Text);
                    item.ZDigharartamamHPD = Int32.Parse(ZDigharartamamHPD.Text);
                    item.ZDighararsaatT    = Int32.Parse(ZDighararsaatT.Text);
                    item.ZDighararsaatHPR  = Int32.Parse(ZDighararsaatHPR.Text);
                    item.ZDighararsaatHPD  = Int32.Parse(ZDighararsaatHPD.Text);
                    item.ZDivazifeT        = Int32.Parse(ZDivazifeT.Text);
                    item.ZDivazifeHPR      = Int32.Parse(ZDivazifeHPR.Text);
                    item.ZDivazifeHPD      = Int32.Parse(ZDivazifeHPD.Text);

                    item.LrasmiT         = Int32.Parse(LrasmiT.Text);
                    item.LrasmiHPR       = Int32.Parse(LrasmiHPR.Text);
                    item.LrasmiHPD       = Int32.Parse(LrasmiHPD.Text);
                    item.LgharartamamT   = Int32.Parse(LgharartamamT.Text);
                    item.LgharartamamHPR = Int32.Parse(LgharartamamHPR.Text);
                    item.LgharartamamHPD = Int32.Parse(LgharartamamHPD.Text);
                    item.LghararsaatT    = Int32.Parse(LghararsaatT.Text);
                    item.LghararsaatHPR  = Int32.Parse(LghararsaatHPR.Text);
                    item.LghararsaatHPD  = Int32.Parse(LghararsaatHPD.Text);
                    item.LvazifeT        = Int32.Parse(LvazifeT.Text);
                    item.LvazifeHPR      = Int32.Parse(LvazifeHPR.Text);
                    item.LvazifeHPD      = Int32.Parse(LvazifeHPD.Text);

                    item.DirasmiT         = Int32.Parse(DirasmiT.Text);
                    item.DirasmiHPR       = Int32.Parse(DirasmiHPR.Text);
                    item.DirasmiHPD       = Int32.Parse(DirasmiHPD.Text);
                    item.DigharartamamT   = Int32.Parse(DigharartamamT.Text);
                    item.DigharartamamHPR = Int32.Parse(DigharartamamHPR.Text);
                    item.DigharartamamHPD = Int32.Parse(DigharartamamHPD.Text);
                    item.DighararsaatT    = Int32.Parse(DighararsaatT.Text);
                    item.DighararsaatHPR  = Int32.Parse(DighararsaatHPR.Text);
                    item.DighararsaatHPD  = Int32.Parse(DighararsaatHPD.Text);
                    item.DivazifeT        = Int32.Parse(DivazifeT.Text);
                    item.DivazifeHPR      = Int32.Parse(DivazifeHPR.Text);
                    item.DivazifeHPD      = Int32.Parse(DivazifeHPD.Text);

                    item.FLrasmiT         = Int32.Parse(FLrasmiT.Text);
                    item.FLrasmiHPR       = Int32.Parse(FLrasmiHPR.Text);
                    item.FLrasmiHPD       = Int32.Parse(FLrasmiHPD.Text);
                    item.FLgharartamamT   = Int32.Parse(FLgharartamamT.Text);
                    item.FLgharartamamHPR = Int32.Parse(FLgharartamamHPR.Text);
                    item.FLgharartamamHPD = Int32.Parse(FLgharartamamHPD.Text);
                    item.FLghararsaatT    = Int32.Parse(FLghararsaatT.Text);
                    item.FLghararsaatHPR  = Int32.Parse(FLghararsaatHPR.Text);
                    item.FLghararsaatHPD  = Int32.Parse(FLghararsaatHPD.Text);
                    item.FLvazifeT        = Int32.Parse(FLvazifeT.Text);
                    item.FLvazifeHPR      = Int32.Parse(FLvazifeHPR.Text);
                    item.FLvazifeHPD      = Int32.Parse(FLvazifeHPD.Text);

                    dbcontext.SaveChanges();
                    this.Hide();
                }
                catch
                {
                }
            }
            Form9_money_sarmaye form9 = new Form9_money_sarmaye();

            form9.Show();
            this.Hide();
        }