Exemple #1
0
        private void filter_Click(object sender, EventArgs e)
        {
            using (Model.Context dbcontext = new Model.Context())
            {
                user newUser = new user()
                {
                    //family_Number = family_Number.Text,
                    //grade = grade.Text,
                    //madrak = madrak.Text,
                    //madrak_Title = madrak.Text,
                    //maskan = maskan.Text,
                    //meli_Code = meli_Code.Text,
                    //mobile = mobile.Text,
                    name         = name.Text,
                    pasdari_Code = pasdari_Code.Text,
                    shomareHesab = shomareHesab.Text,
                    //phone = phone.Text,
                    sazman_Enterdate = DateTime.Now, // sazman_Enterdate.GetSelectedDateInPersianDateTime().ToShortDateString().ToGeorgianDateTime(),
                    Sepah_Enterdate  = DateTime.Now, //Sepah_Enterdate.GetSelectedDateInPersianDateTime().ToShortDateString().ToGeorgianDateTime(),
                    //tahol = tahol.Text,
                    //univercity = univercity.Text,
                    //univercity_Score = shomareHesab.Text,
                    //jaygah = jaygah.Text
                };
                dbcontext.users.Add(newUser);
                dbcontext.SaveChanges();

                DataTable dt       = new DataTable();
                User_List userList = new User_List(dt);
                userList.Show();
                this.Hide();
            }
        }
Exemple #2
0
        private void label3_Click(object sender, EventArgs e)
        {
            string shenasnameID = GlobalVariable.shenasnameID;

            using (var dbcontext = new Model.Context())
            {
                shenasname shen = dbcontext.shenasnames.SingleOrDefault(x => x.ID == shenasnameID);

                if (shen.final != 1)
                {
                    string parentID = shen.parent;

                    List <shenasname> shenList = dbcontext.shenasnames.Where(x => x.parent == parentID).ToList();
                    foreach (shenasname item in shenList)
                    {
                        item.master = "0";
                    }
                    ;
                    shen.isDone = true;
                    shen.master = "1";
                    shen.final  = 1;

                    dbcontext.SaveChanges();
                }

                this.Hide();
                Form5_shenasnameList form5 = new Form5_shenasnameList();
                form5.Show();
            }
        }
Exemple #3
0
        private void label18_Click(object sender, EventArgs e)
        {
            string shenasnameID = GlobalVariable.shenasnameID;

            using (var dbcontext = new Model.Context())
            {
                shenasname shen = dbcontext.shenasnames.SingleOrDefault(x => x.ID == shenasnameID);

                if (shen.final != 1)
                {
                    shen.comment = commentSection.Text;
                    //string parentID = shen.parent;

                    //List<shenasname> shenList = dbcontext.shenasnames.Where(x => x.parent == parentID).ToList();
                    //foreach (shenasname item in shenList)
                    //{
                    //    item.master = "0";
                    //};
                    //shen.isDone = true;
                    //shen.master = "1";
                    //shen.final = 1;
                    dbcontext.SaveChanges();
                }
                //GlobalVariable.shenasnameID = shen.parent;
            }
            this.Hide();
            projectFiles pf = new projectFiles();

            pf.Show();
        }
Exemple #4
0
        private void filter_Click(object sender, EventArgs e)
        {
            string bakhshID = GlobalVariable.bakhshID;

            using (var dbcontext = new Model.Context())
            {
                bakhsh bakh = dbcontext.bakhshes.SingleOrDefault(x => x.ID == bakhshID);

                if (bakh.final != 1)
                {
                    string parentID = bakh.parent;
                    bakh.title    = title.Text;
                    bakh.masoul   = masool.Text;
                    bakh.janeshin = janeshin.Text;


                    List <bakhsh> lst = dbcontext.bakhshes.Where(x => x.parent == parentID).ToList();
                    foreach (bakhsh item in lst)
                    {
                        item.master = "0";
                    }
                    ;
                    bakh.isDone = true;
                    bakh.master = "1";
                    bakh.final  = 1;
                    dbcontext.SaveChanges();
                }
                GlobalVariable.bakhshID = bakh.parent;
            }

            this.Hide();
            Bakhsh_List form5 = new Bakhsh_List();

            form5.Show();
        }
Exemple #5
0
        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            using (var dbcontext = new Model.Context())
            {
                int iSelectedGridIndex = dataGridView1.CurrentCell.ColumnIndex;
                if (iSelectedGridIndex != 0)
                {
                    return;
                }
                int rowindex = dataGridView1.CurrentCell.RowIndex;
                int rowID    = Int32.Parse(dataGridView1.Rows[rowindex].Cells[2].Value.ToString());

                Model.archive model = dbcontext.Archives.SingleOrDefault(x => x.ID == rowID);

                dbcontext.Entry(model).State = EntityState.Deleted;
                dbcontext.SaveChanges();



                List <Model.archive> lst = (from p in dbcontext.Archives
                                            where p.hesab == "1"
                                            select p).ToList();
                dataGridView1.DataSource = lst;
                string imageName = model.imageName;
                var    directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);


                System.IO.File.Delete(directory + imageName);
            }
        }
Exemple #6
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     using (var dbcontext = new Model.Context())
     {
         Model.shenasname item = dbcontext.shenasnames.Where(x => x.ID == GlobalVariable.shenasnameID).FirstOrDefault();
         if (item.final != 1)
         {
             Form20_addSayer form = new Form20_addSayer();
             form.Show();
         }
     }
 }
Exemple #7
0
        private void shomareSanad_Leave(object sender, EventArgs e)
        {
            var number = shomareSanad.Text;

            using (Model.Context dbcontext = new Model.Context())
            {
                tamin model = dbcontext.tamins.FirstOrDefault(x => x.shomareSanad == number);
                if (model != null)
                {
                    header.Text      = "این شماره قبلا ثبت شده است";
                    header.ForeColor = Color.Red;
                }
            }
        }
Exemple #8
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            using (var dbcontext = new Model.Context())
            {
                int           iSelectedGridIndex = dataGridView1.CurrentCell.ColumnIndex;
                int           rowindex           = dataGridView1.CurrentCell.RowIndex;
                int           rowID     = Int32.Parse(dataGridView1.Rows[rowindex].Cells[2].Value.ToString());
                Model.archive model     = dbcontext.Archives.SingleOrDefault(x => x.ID == rowID);
                string        imageName = "";
                if (iSelectedGridIndex == 1)
                {
                    imageName = model.imageName;
                }
                else if (iSelectedGridIndex == 0)
                {
                    Model.tamin tmodel = dbcontext.tamins.SingleOrDefault(x => x.shomareSanad == model.shomareTamin);
                    imageName = tmodel.imageName;
                }

                if (imageName != "")
                {
                    try
                    {
                        var directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

                        if (Path.GetExtension(imageName) == ".pdf")
                        {
                            try
                            {
                                factorPdf factore = new factorPdf(directory + imageName);
                                factore.Show();
                            }
                            catch (Exception error)
                            {
                                label1.Text = error.InnerException.Message;
                            }
                        }
                        else
                        {
                            factorImage factor = new factorImage(directory + imageName);
                            factor.Show();
                        }
                    }
                    catch (Exception error)
                    {
                    }
                }
            }
        }
Exemple #9
0
        private void filter_Click(object sender, EventArgs e)
        {
            using (Model.Context dbcontext = new Model.Context())
            {
                bank newBank = new bank()
                {
                    number = shomareHesab.Text,
                    title  = name.Text,
                    type   = bankType.SelectedItem.ToString(),
                };
                dbcontext.banks.Add(newBank);
                dbcontext.SaveChanges();

                DataTable dt       = new DataTable();
                Bank_List userList = new Bank_List(dt);
                userList.Show();
                this.Hide();
            }
        }
Exemple #10
0
        private void dataGridView1_CellContentDoubleClick_1(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.ejraeiat model = dbcontext.ejraeiats.SingleOrDefault(x => x.title == rowID);
                    dbcontext.Entry(model).State = EntityState.Deleted;
                    dbcontext.SaveChanges();
                    int index = 0;
                    foreach (Form form in Application.OpenForms)
                    {
                        if (form.Name == "Form6-Money-Ejraeiat")
                        {
                            break;
                        }
                        else
                        {
                            index += 1;
                        }
                    }
                    this.Hide();

                    Application.OpenForms[index - 1].Close();
                    Form6_PMainMoney form6 = new Form6_PMainMoney();
                    form6.Show();
                }
            }
        }
Exemple #11
0
        private void filter_Click(object sender, EventArgs e)
        {
            string markazID = GlobalVariable.markazID;

            using (var dbcontext = new Model.Context())
            {
                markaz marz = dbcontext.markazs.SingleOrDefault(x => x.ID == markazID);

                if (marz.final != 1)
                {
                    string parentID = marz.parent;
                    marz.title    = title.Text;
                    marz.masoul   = masool.Text;
                    marz.janeshin = janeshin.Text;
                    marz.BakhshID = "0";// bakhsh.SelectedValue.ToString();


                    List <markaz> lst = dbcontext.markazs.Where(x => x.parent == parentID).ToList();
                    foreach (markaz item in lst)
                    {
                        item.master = "0";
                    }
                    ;
                    marz.isDone = true;
                    marz.master = "1";
                    marz.final  = 1;
                    dbcontext.SaveChanges();
                }
                GlobalVariable.markazID = marz.parent;
            }

            this.Hide();
            Markaz_List form5 = new Markaz_List();

            form5.Show();
        }
Exemple #12
0
        public Komite_Add()
        {
            InitializeComponent();
            Model.Context dbcontext = new Model.Context();

            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);

            this.MaximizeBox = false;
            this.CenterToScreen();



            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;


            radPanel2.PanelElement.Shape = new RoundRectShape();
            radPanel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel2.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel3.PanelElement.Shape = new RoundRectShape();
            radPanel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel3.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel4.PanelElement.Shape = new RoundRectShape();
            radPanel4.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel4.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel5.PanelElement.Shape = new RoundRectShape();
            radPanel5.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel5.PanelElement.PanelFill.BackColor     = Color.Gray;

            string komiteID                   = GlobalVariable.comiteID;
            List <Model.shenasname> lst       = new List <Model.shenasname>();
            List <user>             userlist  = dbcontext.users.ToList();
            List <user>             userlist2 = dbcontext.users.ToList();



            List <user> list = dbcontext.users.ToList();


            masool.DataSource    = userlist;
            masool.DisplayMember = "name";
            masool.ValueMember   = "ID";

            janeshin.DataSource    = userlist2;
            janeshin.DisplayMember = "name";
            janeshin.ValueMember   = "ID";


            List <markaz> markazlist = dbcontext.markazs.Where(x => x.master == "1").ToList();

            bakhsh.DataSource    = markazlist;
            bakhsh.DisplayMember = "title";
            bakhsh.ValueMember   = "parent";


            if (komiteID != "" && komiteID != null)
            {
                komite selectedbakhsh = dbcontext.komites.SingleOrDefault(x => x.ID == komiteID);

                lst = (from p in dbcontext.shenasnames where p.markaz == selectedbakhsh.parent && p.master == "1" select p).ToList();
                //dataGridView1.DataSource = lst;



                title.Text             = selectedbakhsh.title;
                masool.SelectedIndex   = masool.FindStringExact(selectedbakhsh.masoul);
                janeshin.SelectedIndex = janeshin.FindStringExact(selectedbakhsh.janeshin);
                if (selectedbakhsh.markazID != null)
                {
                    bakhsh.SelectedValue = selectedbakhsh.markazID;
                }
            }
            else
            {
                //dataGridView1.DataSource = lst;
            }
        }
Exemple #13
0
        public Form19_saryer()
        {
            string shenasnameID = GlobalVariable.shenasnameID;

            InitializeComponent();
            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);
            header.Font      = mostaan.GlobalVariable.headerlistFONT;
            this.MaximizeBox = false;
            this.CenterToScreen();

            //panel1.PanelElement.Shape = new RoundRectShape();
            //panel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            //panel1.PanelElement.PanelFill.BackColor = Color.White;

            panel2.PanelElement.Shape = new RoundRectShape();
            panel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel2.PanelElement.PanelFill.BackColor     = Color.White;

            panel3.PanelElement.Shape = new RoundRectShape();
            panel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel3.PanelElement.PanelFill.BackColor     = Color.Violet;


            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel2.PanelElement.Shape = new RoundRectShape();
            radPanel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel2.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel3.PanelElement.Shape = new RoundRectShape();
            radPanel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel3.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel4.PanelElement.Shape = new RoundRectShape();
            radPanel4.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel4.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel5.PanelElement.Shape = new RoundRectShape();
            radPanel5.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel5.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel6.PanelElement.Shape = new RoundRectShape();
            radPanel6.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel6.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel7.PanelElement.Shape = new RoundRectShape();
            radPanel7.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel7.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel8.PanelElement.Shape = new RoundRectShape();
            radPanel8.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel8.PanelElement.PanelFill.BackColor     = Color.Violet;

            radPanel9.PanelElement.Shape = new RoundRectShape();
            radPanel9.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel9.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel10.PanelElement.Shape = new RoundRectShape();
            radPanel10.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel10.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;



            radPanel13.PanelElement.Shape = new RoundRectShape();
            radPanel13.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel13.PanelElement.PanelFill.BackColor     = Color.Blue;
            radPanel14.PanelElement.Shape = new RoundRectShape();
            radPanel14.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel14.PanelElement.PanelFill.BackColor     = Color.Gray;


            label1.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label4.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label5.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label6.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label7.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label8.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label9.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label10.Font = GlobalVariable.headerlistFONTsupecSmall;
            label11.Font = GlobalVariable.headerlistFONTsupecSmall;


            using (var dbcontext = new Model.Context())
            {
                List <Model.sayer> lst = (from p in dbcontext.sayers where p.shenasnameID == shenasnameID select p).ToList();
                dataGridView1.DataSource = lst;
                foreach (var item in lst)
                {
                    item.ID = lst.IndexOf(item) + 1;
                }
            }



            dataGridView1.Width = 2300;

            dataGridView1.Columns["ID"].HeaderText                    = "ردیف";
            dataGridView1.Columns["ID"].Width                         = 120;
            dataGridView1.Columns["ID"].DisplayIndex                  = 1;
            dataGridView1.Columns["title"].HeaderText                 = "نام دستگاه";
            dataGridView1.Columns["title"].Width                      = 180;
            dataGridView1.Columns["title"].DisplayIndex               = 2;
            dataGridView1.Columns["title"].DefaultCellStyle.Font      = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns["creatoreCo"].HeaderText            = "شرکت سازنده یا فروشنده";
            dataGridView1.Columns["creatoreCo"].Width                 = 180;
            dataGridView1.Columns["creatoreCo"].DisplayIndex          = 3;
            dataGridView1.Columns["creatoreCo"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns["count"].HeaderText   = "تعداد";
            dataGridView1.Columns["count"].Width        = 180;
            dataGridView1.Columns["count"].DisplayIndex = 4;

            dataGridView1.Columns["vahedPR"].HeaderText   = "قیمت واحد پیش بینی ریالی";
            dataGridView1.Columns["vahedPR"].Width        = 180;
            dataGridView1.Columns["vahedPR"].DisplayIndex = 5;
            dataGridView1.Columns["vahedNR"].HeaderText   = "قیمت واحد نهایی ریالی";
            dataGridView1.Columns["vahedNR"].Width        = 180;
            dataGridView1.Columns["vahedNR"].DefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.Columns["vahedNR"].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns["vahedNR"].DisplayIndex = 6;
            dataGridView1.Columns["vahedPD"].HeaderText   = "قیمت واحد پیش بینی دلاری";
            dataGridView1.Columns["vahedPD"].Width        = 180;
            dataGridView1.Columns["vahedPD"].DisplayIndex = 7;
            dataGridView1.Columns["vahedND"].HeaderText   = "قیمت واحد نهایی دلاری";
            dataGridView1.Columns["vahedND"].Width        = 180;
            dataGridView1.Columns["vahedND"].DisplayIndex = 8;
            dataGridView1.Columns["vahedND"].DefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.Columns["vahedND"].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns["kollPR"].HeaderText   = "کل پیش بینی ریالی";
            dataGridView1.Columns["kollPR"].Width        = 180;
            dataGridView1.Columns["kollPR"].DisplayIndex = 9;
            dataGridView1.Columns["kollNR"].HeaderText   = "کل نهایی ریالی";
            dataGridView1.Columns["kollNR"].Width        = 180;
            dataGridView1.Columns["kollNR"].DisplayIndex = 10;
            dataGridView1.Columns["kollNR"].DefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.Columns["kollNR"].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns["kollPD"].HeaderText   = "کل پیش بینی دلاری";
            dataGridView1.Columns["kollPD"].Width        = 180;
            dataGridView1.Columns["kollPD"].DisplayIndex = 11;
            dataGridView1.Columns["kollND"].HeaderText   = "کل نهایی دلاری";
            dataGridView1.Columns["kollND"].Width        = 180;
            dataGridView1.Columns["kollND"].DisplayIndex = 12;
            dataGridView1.Columns["kollND"].DefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.Columns["kollND"].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns["shenasnameID"].Visible = false;
            // dataGridView1.Columns["ID"].Visible = false;



            dataGridView1.Columns[0].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[1].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[2].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[3].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[4].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[5].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[6].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[7].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[8].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[9].HeaderCell.Style.Font  = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[10].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[11].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[12].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns[0].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[1].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[2].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[3].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[4].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[5].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[6].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[7].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[8].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[9].HeaderCell.Style.Alignment  = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[10].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[11].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[12].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.EnableHeadersVisualStyles = false;

            dataGridView1.DefaultCellStyle.Font      = GlobalVariable.headerlistFONTsmall;
            dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
        }
Exemple #14
0
        public Form2_shenasnameAdd()
        {
            string shenasnameID = GlobalVariable.shenasnameID;

            Model.Context dbcontext = new Model.Context();
            InitializeComponent();
            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);
            header.Font = mostaan.GlobalVariable.headerlistFONTBold;
            //dateFrom.Font = GlobalVariable.headerlistFONTsupecSmall;
            //dateTo.Font = GlobalVariable.headerlistFONTsupecSmall;
            this.MaximizeBox = false;
            this.CenterToScreen();

            panel1.PanelElement.Shape = new RoundRectShape();
            panel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel1.PanelElement.PanelFill.BackColor     = Color.White;

            panel2.PanelElement.Shape = new RoundRectShape();
            panel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel2.PanelElement.PanelFill.BackColor     = Color.White;

            panel3.PanelElement.Shape = new RoundRectShape();
            panel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel3.PanelElement.PanelFill.BackColor     = Color.Violet;


            radPanel10.PanelElement.Shape = new RoundRectShape();
            radPanel10.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel10.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel11.PanelElement.Shape = new RoundRectShape();
            radPanel11.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel11.PanelElement.PanelFill.BackColor     = Color.White;

            //radPanel12.PanelElement.Shape = new RoundRectShape();
            //radPanel12.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            //radPanel12.PanelElement.PanelFill.BackColor = Color.White;

            radPanel13.PanelElement.Shape = new RoundRectShape();
            radPanel13.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel13.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel14.PanelElement.Shape = new RoundRectShape();
            radPanel14.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel14.PanelElement.PanelFill.BackColor     = Color.White;


            radPanel16.PanelElement.Shape = new RoundRectShape();
            radPanel16.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel16.PanelElement.PanelFill.BackColor     = Color.Gray;



            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.Gray;


            List <Model.markaz> bakhshlist  = dbcontext.markazs.Where(x => x.master == "1").ToList();
            List <Model.markaz> bakhshlist2 = dbcontext.markazs.Where(x => x.master == "1").ToList();

            markazcombo.DataSource    = bakhshlist;
            markazcombo.DisplayMember = "title";
            markazcombo.ValueMember   = "parent";

            dastgah.DataSource    = bakhshlist2;
            dastgah.DisplayMember = "title";
            dastgah.ValueMember   = "parent";

            List <Model.user> userlist = dbcontext.users.ToList();

            tarah.DataSource    = userlist;
            tarah.DisplayMember = "name";
            tarah.ValueMember   = "ID";

            List <Model.shenasnameGam>     lst        = new List <Model.shenasnameGam>();
            List <Model.shenasnameFounder> lstFounder = new List <Model.shenasnameFounder>();

            if (shenasnameID != "")
            {
                Model.shenasname     item        = dbcontext.shenasnames.Where(x => x.ID == GlobalVariable.shenasnameID).FirstOrDefault();
                List <string>        taminIDKist = dbcontext.Archives.Where(x => x.hesab == "0").Select(x => x.shomareTamin).ToList();
                List <Model.archive> arch        = (from a in dbcontext.Archives
                                                    where a.project == shenasnameID && a.hesab == "1"
                                                    select a).ToList();
                if (arch.Count() > 0)
                {
                    startDate.Text = arch.First().tarikh.ToPersianDateString();
                    int pishbini = fns.IsDigitsOnly(item.datePishbini) == true?Int32.Parse(item.datePishbini) : 0;

                    endDate.Text = arch.First().tarikh.AddMonths(pishbini).ToPersianDateString();
                }


                List <Model.ejraeiat> PejraRially  = dbcontext.ejraeiats.Where(x => x.shenasnameID == shenasnameID && x.riallyP != 0).ToList();
                List <Model.ejraeiat> pejraDollary = dbcontext.ejraeiats.Where(x => x.shenasnameID == shenasnameID && x.dollaryP != 0).ToList();

                prejraeeyat.Text = PejraRially.Count() > 0 ? string.Format("{0:n0}", PejraRially.Sum(x => x.riallyP)): "0";
                pdejraiat.Text   = pejraDollary.Count() > 0 ? string.Format("{0:n0}", pejraDollary.Sum(x => x.dollaryP)): "0";



                List <Model.tamin> ejraRquery = dbcontext.tamins.Where(x => x.subject == "اجراییات" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long ejraRially = ejraRquery != null?ejraRquery.ToList().Sum(x => x.mablagh) : 0;

                List <Model.tamin> ejraDquery = dbcontext.tamins.Where(x => x.subject == "اجراییات" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long ejrDorllay = ejraDquery != null?ejraDquery.ToList().Sum(x => x.mablagh) : 0;

                hrejrayiat.Text = string.Format("{0:n0}", ejraRially.ToString());
                hdejraeiat.Text = string.Format("{0:n0}", ejrDorllay.ToString());


                List <Model.sarmaye> PsarRially  = dbcontext.sarmayes.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.sarmaye> PsarDollary = dbcontext.sarmayes.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                prsarmaye.Text = PsarRially.Count() > 0 ? string.Format("{0:n0}", PsarRially.Sum(x => x.kollPR)) : "0";
                pdsarmaye.Text = PsarDollary.Count() > 0 ? string.Format("{0:n0}", PsarDollary.Sum(x => x.kollPD)) : "0";

                List <Model.tamin> sarmaRquery = dbcontext.tamins.Where(x => x.subject == "سرمایه" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> sarmaDquery = dbcontext.tamins.Where(x => x.subject == "سرمایه" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long sarmRially = sarmaRquery != null?sarmaRquery.ToList().Sum(x => x.mablagh) : 0;

                long sarmDorllay = sarmaDquery != null?sarmaDquery.ToList().Sum(x => x.mablagh) : 0;

                hrsarmaye.Text = string.Format("{0:n0}", sarmRially.ToString());
                hdsarmaye.Text = string.Format("{0:n0}", sarmDorllay.ToString());


                List <Model.masrafi> PmasRially  = dbcontext.masrafis.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.masrafi> PmasDollary = dbcontext.masrafis.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                prmasrafi.Text = PmasRially.Count() > 0 ? string.Format("{0:n0}", PmasRially.Sum(x => x.kollPR)) : "0";
                pdmasrafi.Text = PmasDollary.Count() > 0 ? string.Format("{0:n0}", PmasDollary.Sum(x => x.kollPD)) : "0";

                List <Model.tamin> masrafiRquery = dbcontext.tamins.Where(x => x.subject == "مصرفی" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> masrafiDquery = dbcontext.tamins.Where(x => x.subject == "مصرفی" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long masrafRially = masrafiRquery != null?masrafiRquery.ToList().Sum(x => x.mablagh) : 0;

                long masrafDorllay = masrafiDquery != null?masrafiDquery.ToList().Sum(x => x.mablagh) : 0;

                hrmasrafi.Text = string.Format("{0:n0}", masrafRially.ToString());
                hdmasrafi.Text = string.Format("{0:n0}", masrafDorllay.ToString());

                List <Model.edari> PedaRially  = dbcontext.edaris.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.edari> PedaDollary = dbcontext.edaris.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                predari.Text = PedaRially.Count() > 0 ? string.Format("{0:n0}", PedaRially.Sum(x => x.kollPR)) : "0";
                pdedari.Text = PedaDollary.Count() > 0 ? string.Format("{0:n0}", PedaDollary.Sum(x => x.kollPD)) : "0";

                List <Model.tamin> edariRquery = dbcontext.tamins.Where(x => x.subject == "اداری" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> edariDquery = dbcontext.tamins.Where(x => x.subject == "اداری" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();

                long edariRially = edariRquery != null?edariRquery.Sum(x => x.mablagh) : 0;

                long edariDorllay = edariDquery != null?edariDquery.Sum(x => x.mablagh) : 0;

                hredari.Text = string.Format("{0:n0}", edariRially.ToString());
                hdedari.Text = string.Format("{0:n0}", edariDorllay.ToString());



                List <Model.omrani> PomrRially  = dbcontext.omranis.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.omrani> PomrDollary = dbcontext.omranis.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                promrani.Text = PomrRially.Count() > 0 ? string.Format("{0:n0}", PomrRially.Sum(x => x.kollPR)) : "0";
                pdomrani.Text = PomrDollary.Count() > 0 ? string.Format("{0:n0}", PomrDollary.Sum(x => x.kollPD)) : "0";


                List <Model.tamin> omraniRquery = dbcontext.tamins.Where(x => x.subject == "عمرانی" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> omraniDquery = dbcontext.tamins.Where(x => x.subject == "عمرانی" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long omraniRially = omraniRquery != null?omraniRquery.Sum(x => x.mablagh) : 0;

                long omraniDorllay = omraniDquery != null?omraniDquery.Sum(x => x.mablagh) : 0;

                hromrani.Text = string.Format("{0:n0}", omraniRially.ToString());
                hdomrani.Text = string.Format("{0:n0}", omraniDorllay.ToString());


                List <Model.gharardad> PgharRially  = dbcontext.gharardads.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.gharardad> PgharDollary = dbcontext.gharardads.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                prgharardad.Text = PgharRially.Count() > 0 ? string.Format("{0:n0}", PgharRially.Sum(x => x.kollPR)) : "0";
                pdgharardad.Text = PgharDollary.Count() > 0 ? string.Format("{0:n0}", PgharDollary.Sum(x => x.kollPD)) : "0";


                List <Model.tamin> ghararRquery = dbcontext.tamins.Where(x => x.subject == "قرارداد" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> ghararDquery = dbcontext.tamins.Where(x => x.subject == "قرارداد" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long ghararRially = ghararRquery != null?ghararRquery.Sum(x => x.mablagh) : 0;

                long ghararDorllay = ghararDquery != null?ghararDquery.Sum(x => x.mablagh) : 0;

                hrgharardad.Text = string.Format("{0:n0}", ghararRially.ToString());
                hdgharardad.Text = string.Format("{0:n0}", ghararDorllay.ToString());


                List <Model.sayer> PsayerRially  = dbcontext.sayers.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.sayer> PsayerDollary = dbcontext.sayers.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                pravalie.Text = PsayerRially.Count() > 0 ? string.Format("{0:n0}", PsayerRially.Sum(x => x.kollPR)) : "0";
                pdavalie.Text = PsayerDollary.Count() > 0 ? string.Format("{0:n0}", PsayerDollary.Sum(x => x.kollPD)) : "0";


                List <Model.tamin> avalieRquery = dbcontext.tamins.Where(x => x.subject == "مواد" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> avalieDquery = dbcontext.tamins.Where(x => x.subject == "مواد" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long avalieRially = avalieRquery != null?avalieRquery.Sum(x => x.mablagh) : 0;

                long avalieDorllay = avalieDquery != null?avalieDquery.Sum(x => x.mablagh) : 0;

                hravalie.Text = string.Format("{0:n0}", avalieRially.ToString());
                hdavalie.Text = string.Format("{0:n0}", avalieDorllay.ToString());

                List <Model.tashvighi> PtashRially  = dbcontext.tashvighis.Where(x => x.shenasnameID == shenasnameID && x.kollPR != 0).ToList();
                List <Model.tashvighi> PtashDollary = dbcontext.tashvighis.Where(x => x.shenasnameID == shenasnameID && x.kollPD != 0).ToList();

                prtashvighi.Text = PtashRially.Count() > 0 ? string.Format("{0:n0}", PtashRially.Sum(x => x.kollPR)) : "0";
                pdtashvighi.Text = PtashDollary.Count() > 0 ? string.Format("{0:n0}", PtashDollary.Sum(x => x.kollPD)) : "0";


                List <Model.tamin> tashvighiRquery = dbcontext.tamins.Where(x => x.subject == "تشویقی" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> tashvighiDquery = dbcontext.tamins.Where(x => x.subject == "تشویقی" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long tashvighiRially = tashvighiRquery != null?tashvighiRquery.Sum(x => x.mablagh) : 0;

                long tashvighiDorllay = tashvighiDquery != null?tashvighiDquery.Sum(x => x.mablagh) : 0;

                hrtashvighi.Text = string.Format("{0:n0}", tashvighiRially.ToString());
                hdtashvighi.Text = string.Format("{0:n0}", tashvighiDorllay.ToString());



                List <Model.tamin> sayerhazineRquery = dbcontext.tamins.Where(x => x.subject == "سایر هزینه ها" && x.type == "ریال" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                List <Model.tamin> sayerhazineDquery = dbcontext.tamins.Where(x => x.subject == "سایر هزینه ها" && x.type == "دلار" && x.hesab == "0" && x.project == shenasnameID && taminIDKist.Contains(x.shomareSanad)).ToList();
                long sayerhazineRially = sayerhazineRquery != null?sayerhazineRquery.Sum(x => x.mablagh) : 0;

                long sayerhazineDorllay = sayerhazineDquery != null?sayerhazineDquery.Sum(x => x.mablagh) : 0;

                hrsayerhazine.Text = string.Format("{0:n0}", sayerhazineRially.ToString());
                hdsayerhazine.Text = string.Format("{0:n0}", sayerhazineDorllay.ToString());

                hrkoll.Text = string.Format("{0:n0}", (avalieRially + edariRially + ejraRially + ghararRially + masrafRially + omraniRially + sarmRially + sayerhazineRially + tashvighiRially).ToString());;
                hdkoll.Text = string.Format("{0:n0}", (avalieDorllay + edariDorllay + ejrDorllay + ghararDorllay + masrafDorllay + omraniDorllay + sarmDorllay + sayerhazineDorllay + tashvighiDorllay).ToString());
                prkoll.Text = string.Format("{0:n0}", (decimal.Parse(prejraeeyat.Text) + decimal.Parse(prsarmaye.Text) + decimal.Parse(predari.Text) + decimal.Parse(prmasrafi.Text) + decimal.Parse(promrani.Text) + decimal.Parse(pravalie.Text) + decimal.Parse(prtashvighi.Text)).ToString());
                pdkoll.Text = string.Format("{0:n0}", (decimal.Parse(pdejraiat.Text) + decimal.Parse(pdsarmaye.Text) + decimal.Parse(pdedari.Text) + decimal.Parse(pdmasrafi.Text) + decimal.Parse(pdomrani.Text) + decimal.Parse(pdavalie.Text) + decimal.Parse(pdtashvighi.Text)).ToString());


                lst = (from p in dbcontext.shenasnameGams where p.shenasnameID == shenasnameID select p).ToList();
                dataGridView1.DataSource = lst;

                lstFounder = (from p in dbcontext.shenasnameFounders where p.shenasnameID == shenasnameID select p).ToList();
                //dataGridView2.DataSource = lstFounder;


                hadaf.Text = item.hadaf;
                title.Text = item.title;

                datePishbini.Text = item.datePishbini;
                //dateFrom.Text = item.dateFrom.ToShortDateString();
                //dateTo.Text = item.dateTo.ToShortDateString();
                if (item.markaz != null)
                {
                    markazcombo.SelectedValue = item.markaz;
                    dastgah.SelectedValue     = item.markaz;
                }
                if (item.tarah != null)
                {
                    tarah.SelectedValue = item.tarah;
                }
            }
            else
            {
                dataGridView1.DataSource = lst;
                //dataGridView2.DataSource = lstFounder;
            }
            dataGridView1.Width = 1300;
            dataGridView1.Columns[1].HeaderText           = "گام های اصلی";
            dataGridView1.Columns[1].Width                = 200;
            dataGridView1.Columns[2].HeaderText           = "عنوان اصلی فعالیت";
            dataGridView1.Columns[2].Width                = 200;
            dataGridView1.Columns[3].HeaderText           = "شرح فعالیت اصلی در این گام";
            dataGridView1.Columns[3].Width                = 300;
            dataGridView1.Columns[4].HeaderText           = "مدت زمان تقریبی (ماه)";
            dataGridView1.Columns[4].Width                = 150;
            dataGridView1.Columns[5].HeaderText           = "درصد وزنی فعالیت";
            dataGridView1.Columns[5].Width                = 150;
            dataGridView1.Columns[6].HeaderText           = "دستاورد";
            dataGridView1.Columns[6].Width                = 300;
            dataGridView1.Columns["shenasnameID"].Visible = false;
            dataGridView1.Columns["ID"].Visible           = false;



            dataGridView1.Columns[6].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[1].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[2].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[3].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[4].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[5].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns[6].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[3].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[4].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[5].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.EnableHeadersVisualStyles = false;

            dataGridView1.DefaultCellStyle.Font      = GlobalVariable.headerlistFONTsmall;
            dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;



            //Phazine.Text = String.Format("{0:n0}", pr) + " ریال و " + string.Format("{0:n0}", pd) + " دلار ";
            //Nhazine.Text = string.Format("{0:n0}", nr) + " ریال و " + string.Format("{0:n0}", nd) + " دلار ";
        }
Exemple #15
0
        public Bakhsh_ShoCopies()
        {
            InitializeComponent();

            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);
            this.MaximizeBox = false;
            this.CenterToScreen();


            string nakhshID = GlobalVariable.bakhshID;

            using (var dbcontext = new Model.Context())
            {
                List <bakhsh> lst = (from p in dbcontext.bakhshes where (p.ID == nakhshID || p.parent == nakhshID) && (p.final == 1) select p).OrderByDescending(x => x.date).ThenByDescending(x => x.time).ToList();

                List <ViewModel.shenasnameCopiesVM> list = new List <ViewModel.shenasnameCopiesVM>();
                foreach (var item in lst)
                {
                    int index = lst.IndexOf(item);

                    string count = index == 0 ? "نسخه نهایی" : "نسخه " + (lst.Count() - (index)).ToString();
                    ViewModel.shenasnameCopiesVM vmitem = new ViewModel.shenasnameCopiesVM()
                    {
                        ID      = item.ID,
                        count   = count,
                        date    = item.date.ToPersianDateString(),
                        changer = item.changer,
                    };
                    list.Add(vmitem);
                }
                dataGridView1.DataSource = list;
            }



            dataGridView1.Columns["ID"].HeaderText   = "ردیف";
            dataGridView1.Columns["ID"].Width        = 110;
            dataGridView1.Columns["ID"].DisplayIndex = 0;

            dataGridView1.Columns["count"].HeaderText            = "نسخه";
            dataGridView1.Columns["count"].Width                 = 200;
            dataGridView1.Columns["count"].DisplayIndex          = 1;
            dataGridView1.Columns["count"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;


            dataGridView1.Columns["date"].HeaderText            = "تاریخ";
            dataGridView1.Columns["date"].Width                 = 200;
            dataGridView1.Columns["date"].DisplayIndex          = 2;
            dataGridView1.Columns["date"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;

            //dataGridView1.Columns["noskhe"].HeaderText = "تغییرات";
            //dataGridView1.Columns["noskhe"].Width = 416;
            //dataGridView1.Columns["noskhe"].DisplayIndex = 3;
            //dataGridView1.Columns["noskhe"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns["changer"].HeaderText            = "تغییر دهنده ";
            dataGridView1.Columns["changer"].Width                 = 200;
            dataGridView1.Columns["changer"].DisplayIndex          = 3;
            dataGridView1.Columns["changer"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;



            dataGridView1.Columns[0].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[1].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[2].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[3].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[4].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;



            dataGridView1.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[3].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[4].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;



            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.EnableHeadersVisualStyles = false;

            dataGridView1.DefaultCellStyle.Font      = GlobalVariable.headerlistFONTsmall;
            dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
        }
Exemple #16
0
        public Form21_tashvighi()
        {
            string shenasnameID = GlobalVariable.shenasnameID;

            InitializeComponent();
            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);
            header.Font      = mostaan.GlobalVariable.headerlistFONT;
            this.MaximizeBox = false;
            this.CenterToScreen();

            //panel1.PanelElement.Shape = new RoundRectShape();
            //panel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            //panel1.PanelElement.PanelFill.BackColor = Color.White;

            panel2.PanelElement.Shape = new RoundRectShape();
            panel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel2.PanelElement.PanelFill.BackColor     = Color.White;

            panel3.PanelElement.Shape = new RoundRectShape();
            panel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel3.PanelElement.PanelFill.BackColor     = Color.Violet;


            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel2.PanelElement.Shape = new RoundRectShape();
            radPanel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel2.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel3.PanelElement.Shape = new RoundRectShape();
            radPanel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel3.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel4.PanelElement.Shape = new RoundRectShape();
            radPanel4.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel4.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel5.PanelElement.Shape = new RoundRectShape();
            radPanel5.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel5.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel6.PanelElement.Shape = new RoundRectShape();
            radPanel6.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel6.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel7.PanelElement.Shape = new RoundRectShape();
            radPanel7.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel7.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel8.PanelElement.Shape = new RoundRectShape();
            radPanel8.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel8.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel9.PanelElement.Shape = new RoundRectShape();
            radPanel9.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel9.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel10.PanelElement.Shape = new RoundRectShape();
            radPanel10.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel10.PanelElement.PanelFill.BackColor     = Color.Violet;

            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;



            radPanel13.PanelElement.Shape = new RoundRectShape();
            radPanel13.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel13.PanelElement.PanelFill.BackColor     = Color.Blue;
            radPanel14.PanelElement.Shape = new RoundRectShape();
            radPanel14.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel14.PanelElement.PanelFill.BackColor     = Color.Gray;


            label1.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label4.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label5.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label6.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label7.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label8.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label9.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label10.Font = GlobalVariable.headerlistFONTsupecSmall;
            label11.Font = GlobalVariable.headerlistFONTsupecSmall;


            using (var dbcontext = new Model.Context())
            {
                List <Model.tashvighi> lst = (from p in dbcontext.tashvighis where p.shenasnameID == shenasnameID select p).ToList();
                dataGridView1.DataSource = lst;
                foreach (var item in lst)
                {
                    item.ID = lst.IndexOf(item) + 1;
                }
            }



            dataGridView1.Width = 1200;

            dataGridView1.Columns["ID"].HeaderText               = "ردیف";
            dataGridView1.Columns["ID"].Width                    = 120;
            dataGridView1.Columns["ID"].DisplayIndex             = 1;
            dataGridView1.Columns["title"].HeaderText            = "گام تشویقی";
            dataGridView1.Columns["title"].Width                 = 216;
            dataGridView1.Columns["title"].DisplayIndex          = 2;
            dataGridView1.Columns["title"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns["title"].HeaderText            = "تشریح تحویلی";
            dataGridView1.Columns["title"].Width                 = 216;
            dataGridView1.Columns["title"].DisplayIndex          = 3;
            dataGridView1.Columns["title"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;


            dataGridView1.Columns["kollPR"].HeaderText   = "مبلغ هزینه ریالی";
            dataGridView1.Columns["kollPR"].Width        = 216;
            dataGridView1.Columns["kollPR"].DisplayIndex = 4;

            dataGridView1.Columns["kollPD"].HeaderText   = "مبلغ هزینه دلاری";
            dataGridView1.Columns["kollPD"].Width        = 216;
            dataGridView1.Columns["kollPD"].DisplayIndex = 5;

            dataGridView1.Columns["shenasnameID"].Visible = false;

            dataGridView1.Columns["ID"].Visible = false;



            dataGridView1.Columns[0].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[1].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[2].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[3].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[4].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[5].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;



            dataGridView1.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[3].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[4].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[5].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;



            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.EnableHeadersVisualStyles = false;

            dataGridView1.DefaultCellStyle.Font      = GlobalVariable.headerlistFONTsmall;
            dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
        }
Exemple #17
0
        private void filter_Click(object sender, EventArgs e)
        {
            var number = shomareSanad.Text;

            using (Model.Context dbcontext = new Model.Context())
            {
                tamin model = dbcontext.tamins.FirstOrDefault(x => x.shomareSanad == number);
                if (model != null)
                {
                    header.Text = "این شماره قبلا ثبت شده است";
                    return;
                }
            }



            if (radif.SelectedValue == null && subject.SelectedItem.ToString() != "سایر هزینه ها")
            {
                header.Text      = "ردیف انتخاب نشده است";
                header.ForeColor = Color.Red;
                return;
            }

            header.Text = "1";
            string sanad           = shomareSanad.Text;
            Int64  mbl             = Int64.Parse(price.Text);
            string prj             = project.SelectedValue.ToString();
            var    shenasname      = context.shenasnames.SingleOrDefault(x => x.ID == prj);
            string shenasnameID    = shenasname.ID;
            string shenasnameTitle = shenasname.title;
            string rd = subject.SelectedText != "مواد اولیه" ? "" : radif.SelectedValue.ToString();

            header.Text = "2";
            archive pastmodel = context.Archives.SingleOrDefault(x => x.hesab == "0" && x.shomareSanad == sanad && x.mablagh == mbl && x.shnesnameTitle == shenasnameTitle && x.radif == rd);

            if (pastmodel != null)
            {
                header.Text      = "برای پارامتر های موجود فاکتور انتخاب شده است";
                header.ForeColor = Color.Red;
                return;
            }



            functions fns       = new functions();
            var       directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);


            string mrk = "";

            mrk = (from sh in context.shenasnames
                   join ma in context.markazs on sh.markaz equals ma.parent
                   where sh.title == shenasnameTitle
                   select ma).First().title;


            header.Text = "3";
            string root = Path.Combine(directory, "FIM");

            System.IO.Directory.CreateDirectory(root);
            string taminPath = Path.Combine(root, "tamin");

            System.IO.Directory.CreateDirectory(taminPath);


            string trkh       = date.GetSelectedDateInPersianDateTime().ToShortDateString().Replace("/", "");
            string finalPrice = "";

            if (shomareSanad.Text == "")
            {
                header.Text      = "شماره سند را وارد نمایید";
                header.ForeColor = Color.Red;
                return;
            }
            if (price.Text == "")
            {
                header.Text      = "مبلغ را وارد نمایید";
                header.ForeColor = Color.Red;
                return;
            }

            float intprice = float.Parse(price.Text);

            if (intprice / 1000000 > 1)
            {
                finalPrice = (intprice / 1000000) + "MT";
            }
            else
            {
                finalPrice = (intprice / 1000) + "HT";
            }

            string finalname    = "";
            string random       = RandomNumber(10000, 99999).ToString();
            string sourcAddress = sourceLable.Text;

            finalname = random + Path.GetExtension(sourcAddress);

            imageName.Text = Path.Combine(taminPath, finalname).Replace(directory, "");
            string finalPath = taminPath + "\\" + finalname;


            //try
            //{
            //    System.IO.File.Delete(sourcAddress);
            //}
            //catch (IOException error)
            //{

            //}

            if (moneytype.SelectedItem == null)
            {
                header.Text      = "واحد پولی را انتخاب کنید";
                header.ForeColor = Color.Red;
                return;
            }

            if (pastmodel != null)
            {
                header.Text      = "برای پارامتر های موجود فاکتور انتخاب شده است";
                header.ForeColor = Color.Red;
                return;
            }



            //string rd = "";
            string rdTitle        = "";
            string choosenSubject = subject.Text;

            if (radif.SelectedValue != null)
            {
                rd = radif.SelectedValue.ToString();
                int intrd = Int32.Parse(rd);

                switch (choosenSubject)
                {
                case "اجراییات":
                    rdTitle = context.ejraeiats.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "سرمایه":
                    rdTitle = context.sarmayes.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "قرارداد":
                    rdTitle = context.gharardads.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "عمرانی":
                    rdTitle = context.omranis.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "اداری":
                    rdTitle = context.edaris.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "مصرفی":
                    rdTitle = context.masrafis.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "مواد":
                    rdTitle = context.sayers.SingleOrDefault(x => x.ID == intrd).title;
                    break;

                case "تشویقی":
                    rdTitle = context.tashvighis.SingleOrDefault(x => x.ID == intrd).title;
                    break;
                }
            }



            bool     isreferbish = referbish.Text == "0" ? false : true;
            string   sbj         = choosenSubject;
            DateTime trk         = date.GetSelectedDateInPersianDateTime().ToShortDateString().ToGeorgianDateTime();
            string   typ         = moneytype.SelectedItem.ToString();
            tamin    newITem     = new tamin()
            {
                radif          = rd,
                mablagh        = mbl,
                markaz         = "",
                project        = shenasnameID,
                shnesnameTitle = shenasnameTitle,
                radifTitle     = rdTitle,
                shomareSanad   = sanad,
                subject        = sbj,
                tarikh         = trk,
                type           = typ,
                hesab          = "0",
                imageName      = imageName.Text,
                //bankName = bank.Text,
                //checkNumber = checkNumber.Text,
                //referbish = isreferbish
            };

            context.tamins.Add(newITem);
            context.SaveChanges();
            webBrowser1.Navigate("http://localhost/");



            DataTable    dt        = new DataTable();
            tamin_Report taminform = new tamin_Report(dt);

            taminform.Show();
            this.Close();
            File.Move(sourcAddress, finalPath);
            try
            {
                File.Delete(sourcAddress);
            }
            catch (IOException error)
            {
            }
        }
Exemple #18
0
        private void label2_Click(object sender, EventArgs e)
        {
            string itemname = itemList.SelectedItem.ToString();

            if (itemname == "")
            {
                return;
            }
            string shenasnameID = GlobalVariable.shenasnameID;

            using (var dbcontext = new Model.Context())
            {
                shenasname shen = dbcontext.shenasnames.SingleOrDefault(x => x.ID == shenasnameID);


                if (shen.final != 1)
                {
                    var    directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
                    string root      = Path.Combine(directory, "FIM");
                    System.IO.Directory.CreateDirectory(root);
                    string trashPath = Path.Combine(root, "asset");
                    System.IO.Directory.CreateDirectory(trashPath);

                    OpenFileDialog f = new OpenFileDialog();
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        string source = Path.GetFullPath(f.FileName);

                        string finalname    = "";
                        Random _random      = new Random();
                        string random       = _random.Next(10000, 99999).ToString();
                        string sourcAddress = source;
                        finalname = random + Path.GetExtension(sourcAddress);
                        string finalPath = trashPath + "\\" + finalname;

                        File.Copy(f.FileName, finalPath);
                        webBrowser1.Navigate(finalPath);



                        switch (itemname)
                        {
                        case "بایگانی موارد":
                            shen.bayganiFile = finalname;
                            break;

                        case "قرارداد":
                            shen.gharardadFile = finalname;
                            break;

                        case "متمم":
                            shen.motamamFile = finalname;
                            break;

                        case "پیوست متنی":
                            shen.peyvastFile = finalname;
                            break;

                        case "لیست مواد":
                            shen.listmavadFile = finalname;
                            break;

                        case "گانت چارت":
                            shen.gantFile = finalname;
                            break;

                        case "مجوز ستاد کل":
                            shen.mojavezFile = finalname;
                            break;

                        case "گزارش پیشرفت":
                            shen.pishraftFile = finalname;
                            break;
                        }
                        dbcontext.SaveChanges();

                        //factorPdf factor = new factorPdf(source);
                        //factor.Show();
                    }
                }
            }
        }
Exemple #19
0
        public Bakhsh_add()
        {
            InitializeComponent();
            Model.Context dbcontext = new Model.Context();

            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);

            this.MaximizeBox = false;
            this.CenterToScreen();



            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;


            radPanel2.PanelElement.Shape = new RoundRectShape();
            radPanel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel2.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel3.PanelElement.Shape = new RoundRectShape();
            radPanel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel3.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel4.PanelElement.Shape = new RoundRectShape();
            radPanel4.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel4.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel5.PanelElement.Shape = new RoundRectShape();
            radPanel5.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel5.PanelElement.PanelFill.BackColor     = Color.Gray;

            string bakhshID               = GlobalVariable.bakhshID;
            List <Model.markaz> lst       = new List <Model.markaz>();
            List <user>         userlist  = dbcontext.users.ToList();
            List <user>         userlist2 = dbcontext.users.ToList();



            List <user> list = dbcontext.users.ToList();


            masool.DataSource    = userlist;
            masool.DisplayMember = "name";
            masool.ValueMember   = "ID";

            janeshin.DataSource    = userlist2;
            janeshin.DisplayMember = "name";
            janeshin.ValueMember   = "ID";


            if (bakhshID != "")
            {
                bakhsh selectedbakhsh = dbcontext.bakhshes.SingleOrDefault(x => x.ID == bakhshID);

                lst = (from p in dbcontext.markazs where p.BakhshID == selectedbakhsh.parent && p.master == "1" select p).ToList();
                dataGridView1.DataSource = lst;


                Model.bakhsh item = dbcontext.bakhshes.Where(x => x.ID == bakhshID).FirstOrDefault();

                title.Text             = item.title;
                masool.SelectedIndex   = masool.FindStringExact(selectedbakhsh.masoul);
                janeshin.SelectedIndex = janeshin.FindStringExact(selectedbakhsh.janeshin);
            }
            else
            {
                dataGridView1.DataSource = lst;
            }



            dataGridView1.Columns["ID"].HeaderText               = "ردیف";
            dataGridView1.Columns["ID"].Width                    = 120;
            dataGridView1.Columns["ID"].DisplayIndex             = 1;
            dataGridView1.Columns["title"].HeaderText            = "عنوان مرکز";
            dataGridView1.Columns["title"].Width                 = 216;
            dataGridView1.Columns["title"].DisplayIndex          = 2;
            dataGridView1.Columns["title"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns["masoul"].HeaderText            = "مسئول مرکز";
            dataGridView1.Columns["masoul"].Width                 = 216;
            dataGridView1.Columns["masoul"].DisplayIndex          = 3;
            dataGridView1.Columns["masoul"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns["janeshin"].HeaderText            = "جانشین مرکز";
            dataGridView1.Columns["janeshin"].Width                 = 216;
            dataGridView1.Columns["janeshin"].DisplayIndex          = 4;
            dataGridView1.Columns["janeshin"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;



            dataGridView1.Columns["parent"].Visible   = false;
            dataGridView1.Columns["final"].Visible    = false;
            dataGridView1.Columns["isDone"].Visible   = false;
            dataGridView1.Columns["master"].Visible   = false;
            dataGridView1.Columns["BakhshID"].Visible = false;
            dataGridView1.Columns["changer"].Visible  = false;
            dataGridView1.Columns["date"].Visible     = false;
            dataGridView1.Columns["time"].Visible     = false;


            // dataGridView1.Columns["ID"].Visible = false;



            dataGridView1.Columns[0].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[1].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[2].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[3].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[4].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;



            dataGridView1.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[3].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[4].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
        }
Exemple #20
0
        public Form15_addOmrani()
        {
            InitializeComponent();

            FontClass      fontclass   = new FontClass();
            List <Control> allControls = fontclass.GetAllControls(this);

            allControls.ForEach(k => k.Font = mostaan.GlobalVariable.headerlistFONTsmall);
            header.Font      = mostaan.GlobalVariable.headerlistFONT;
            this.MaximizeBox = false;
            this.CenterToScreen();

            //panel1.PanelElement.Shape = new RoundRectShape();
            //panel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            //panel1.PanelElement.PanelFill.BackColor = Color.White;

            panel2.PanelElement.Shape = new RoundRectShape();
            panel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel2.PanelElement.PanelFill.BackColor     = Color.White;

            panel3.PanelElement.Shape = new RoundRectShape();
            panel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            panel3.PanelElement.PanelFill.BackColor     = Color.Violet;


            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel2.PanelElement.Shape = new RoundRectShape();
            radPanel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel2.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel3.PanelElement.Shape = new RoundRectShape();
            radPanel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel3.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel4.PanelElement.Shape = new RoundRectShape();
            radPanel4.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel4.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel5.PanelElement.Shape = new RoundRectShape();
            radPanel5.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel5.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel6.PanelElement.Shape = new RoundRectShape();
            radPanel6.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel6.PanelElement.PanelFill.BackColor     = Color.Violet;

            radPanel7.PanelElement.Shape = new RoundRectShape();
            radPanel7.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel7.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel8.PanelElement.Shape = new RoundRectShape();
            radPanel8.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel8.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel9.PanelElement.Shape = new RoundRectShape();
            radPanel9.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel9.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel10.PanelElement.Shape = new RoundRectShape();
            radPanel10.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel10.PanelElement.PanelFill.BackColor     = Color.White;

            radPanel1.PanelElement.Shape = new RoundRectShape();
            radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel1.PanelElement.PanelFill.BackColor     = Color.White;



            radPanel13.PanelElement.Shape = new RoundRectShape();
            radPanel13.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel13.PanelElement.PanelFill.BackColor     = Color.Blue;
            radPanel14.PanelElement.Shape = new RoundRectShape();
            radPanel14.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
            radPanel14.PanelElement.PanelFill.BackColor     = Color.Gray;


            label1.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label4.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label5.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label6.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label7.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label8.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label9.Font  = GlobalVariable.headerlistFONTsupecSmall;
            label10.Font = GlobalVariable.headerlistFONTsupecSmall;
            label11.Font = GlobalVariable.headerlistFONTsupecSmall;


            using (var dbcontext = new Model.Context())
            {
                List <Model.omrani> lst = (from p in dbcontext.omranis where p.shenasnameID == shenasnameID select p).ToList();
                dataGridView1.DataSource = lst;
                foreach (var item in lst)
                {
                    item.ID = lst.IndexOf(item) + 1;
                }
            }



            dataGridView1.Width = 1600;

            dataGridView1.Columns["ID"].HeaderText               = "ردیف";
            dataGridView1.Columns["ID"].Width                    = 120;
            dataGridView1.Columns["ID"].DisplayIndex             = 1;
            dataGridView1.Columns["title"].HeaderText            = "شرح ساختمان مورد نیاز";
            dataGridView1.Columns["title"].Width                 = 216;
            dataGridView1.Columns["title"].DisplayIndex          = 2;
            dataGridView1.Columns["title"].DefaultCellStyle.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns["zirbana"].HeaderText          = "زیر بنای مورد نیاز (متر مربع)";
            dataGridView1.Columns["zirbana"].Width               = 216;
            dataGridView1.Columns["zirbana"].DisplayIndex        = 3;

            dataGridView1.Columns["kollPR"].HeaderText   = "کل پیش بینی ریالی";
            dataGridView1.Columns["kollPR"].Width        = 216;
            dataGridView1.Columns["kollPR"].DisplayIndex = 4;
            dataGridView1.Columns["kollNR"].HeaderText   = "کل نهایی ریالی";
            dataGridView1.Columns["kollNR"].Width        = 216;
            dataGridView1.Columns["kollNR"].DisplayIndex = 5;
            dataGridView1.Columns["kollNR"].DefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.Columns["kollNR"].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns["kollPD"].HeaderText   = "کل پیش بینی دلاری";
            dataGridView1.Columns["kollPD"].Width        = 216;
            dataGridView1.Columns["kollPD"].DisplayIndex = 6;
            dataGridView1.Columns["kollND"].HeaderText   = "کل نهایی دلاری";
            dataGridView1.Columns["kollND"].Width        = 216;
            dataGridView1.Columns["kollND"].DisplayIndex = 7;
            dataGridView1.Columns["kollND"].DefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.Columns["kollND"].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns["shenasnameID"].Visible = false;

            // dataGridView1.Columns["ID"].Visible = false;



            dataGridView1.Columns[0].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[1].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[2].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[3].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[4].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[5].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[6].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[7].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;
            dataGridView1.Columns[8].HeaderCell.Style.Font = GlobalVariable.headerlistFONTsupecSmall;

            dataGridView1.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[3].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[4].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[5].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[6].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[7].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns[8].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;



            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Gray;
            dataGridView1.EnableHeadersVisualStyles = false;

            dataGridView1.DefaultCellStyle.Font      = GlobalVariable.headerlistFONTsmall;
            dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
        }