Beispiel #1
0
        public List <Contract> Search(int currentPage, ref decimal totalRecord, string keySearch = "")
        {
            List <Contract> lstContract = new List <Contract>();
            var             contractDa  = new ContractDA();

            try
            {
                string p_contract_code = "";
                string p_contract_date = "";
                string p_import_object = "";
                string p_status        = "";
                var    arrKeySearch    = keySearch.Split('|');
                if (arrKeySearch.Length >= 4)
                {
                    p_contract_code = arrKeySearch[0];
                    p_contract_date = arrKeySearch[1];
                    p_import_object = arrKeySearch[2];
                    p_status        = arrKeySearch[3];
                }
                string p_to   = Common.RecordOnpage.ToString();
                string p_from = CommonFuc.Get_From_To_Page(currentPage, ref p_to);

                var ds = contractDa.Search(p_contract_code, p_contract_date, p_import_object, p_status, p_from, p_to, ref totalRecord);
                lstContract = CBO <Contract> .FillCollectionFromDataSet(ds);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
                lstContract = new List <Contract>();
            }
            return(lstContract);
        }
Beispiel #2
0
        public decimal Update_ContainShipment(Contract contract, List <Shipment> shipments, List <ContractDetail> contractDetails)
        {
            decimal _result    = -1;
            var     contractDa = new ContractDA();

            try
            {
                _result = contractDa.UpdateContract_ContainShipments(contract, shipments.ToArray(), contractDetails.ToArray());
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
                _result = -1;
            }
            return(_result);
        }
Beispiel #3
0
        public Contract GetByName(string name)
        {
            Contract contract   = new Contract();
            var      contractDa = new ContractDA();

            try
            {
                var ds = contractDa.GetByName(name);
                contract = CBO <Contract> .FillObject_From_DataSet(ds);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
                contract = new Contract();
            }
            return(contract);
        }
Beispiel #4
0
 public ContractController(IConfiguration Configuration, IDataAccess DAccess)
 {
     this.Configuration = Configuration;
     this.DAccess       = DAccess;
     this.DAContr       = new ContractDA(ref this.DAccess, "Contract");
 }