コード例 #1
0
 public ManagerPanel()
 {
     EmployeeNameRole  = new Dictionary <string, string>();
     SupplierNameID    = new Dictionary <int, string>();
     empNameList       = new List <string>();
     supplierNameList  = new List <string>();
     apiHandler        = new APIHandler();
     dataBaseHandler   = new DataBaseHandler();
     moneyHandler      = new MoneyHandler();
     dataHandler       = new DataHandler();
     dgHandler         = new DataGridViewHandler();
     empRoleList       = new List <string>();
     employeeWagesList = new List <EmployeeWages>();
     employeeWages     = new EmployeeWages();
     sales             = new Sales();
     supplier          = new Supplier();
     salesList         = new List <Sales>();
     ListAllEmployees();
     InitializeComponent();
     initializeValues();
     ChangeDateTimePickerFormat();
     //txtSupplierAmount.TextChanged += TextChanged;
 }
コード例 #2
0
        internal void PostSuplierGVRecords(APIHandler apiHandler, DataGridView dg_salesRecord)
        {
            List <Supplier> supplierList = new List <Supplier>();
            Supplier        supplier     = null;;

            foreach (DataGridViewRow row in dg_salesRecord.Rows)
            {
                if (row.Cells[0].Value != null)
                {
                    supplier = new Supplier();
                    //  supplier.SupplierID = 0;
                    supplier.Date         = Convert.ToDateTime(row.Cells[0].Value.ToString());
                    supplier.SupplierName = Convert.ToString(row.Cells[1].Value.ToString());
                    supplier.TotalAmount  = Convert.ToDouble(row.Cells[2].Value.ToString());
                    supplier.AmountPaid   = Convert.ToDouble(row.Cells[3].Value.ToString());
                    supplier.AmountDue    = Convert.ToDouble(row.Cells[4].Value.ToString());
                    supplierList.Add(supplier);
                }
            }
            if (supplierList.Count > 0)
            {
                apiHandler.AddSupplierData(supplierList);
            }
        }