Пример #1
0
        public ANCQuantityAdd(int AddMonth, int AddYear, string[] DataToAdd)
        {
            var ANCList = ANCMonthlyQuantity.LoadByYear_Month(AddYear, AddMonth);

            if (ANCList != null)
            {
                ANCMonthlyQuantity.RemoveList(ANCList);
            }

            List <ANCMonthlyDB> ListANC = new List <ANCMonthlyDB>();

            foreach (string Data in DataToAdd)
            {
                string[] AddData = Data.Split('\t');

                if (AddData.Length != 1)
                {
                    var NewRow = new ANCMonthlyDB
                    {
                        ANC   = AddData[0].ToString(),
                        Year  = AddYear,
                        Month = AddMonth,
                        Value = Convert.ToDouble(AddData[1])
                    };
                    ListANC.Add(NewRow);
                }
            }


            if (ListANC != null)
            {
                ANCMonthlyQuantity.AddList(ListANC);
            }
        }
Пример #2
0
        private void But_ANCMonthly_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            var Option = MainProgram.Self.adminTableView.optionsView;
            var Table  = MainProgram.Self.adminTableView.ReturnDataGridView();

            if (Option.GetMonth() != 0)
            {
                Table.DataSource = ANCMonthlyQuantity.LoadByYear_Month(Convert.ToInt32(Option.GetYear()), Convert.ToInt32(Option.GetMonth()));
            }
            else
            {
                Table.DataSource = ANCMonthlyQuantity.LoadByYear(Convert.ToInt32(Option.GetYear()));
            }

            Cursor.Current = Cursors.Default;
        }