Example #1
0
        public StockOutFGReqData GetRequisitionData(double requisition)
        {
            StockOutFGReqData data = new StockOutFGReqData();
            OracleDBObj obj = new OracleDBObj();
            obj.CreateConnection();
            obj.CreateTransaction();
            try
            {
                ReqDAL.GetDataByLOID(requisition, obj.zTrans);
                data.CADDRESS = ReqDAL.CADDRESS;
                data.CFAX = ReqDAL.CFAX;
                data.CLASTNAME = ReqDAL.CLASTNAME;
                data.CNAME = ReqDAL.CNAME;
                data.CTEL = ReqDAL.CTEL;
                data.CTITLE = ReqDAL.CTITLE;
                data.CUSTOMER = ReqDAL.CUSTOMER;
                CustomerDAL cDAL = new CustomerDAL();
                cDAL.GetDataByLOID(data.CUSTOMER, obj.zTrans);
                data.CUSTOMERCODE = cDAL.CODE;
                data.CUSTOMERNAME = (cDAL.NAME + " " + cDAL.LASTNAME).Trim();
                data.REQUISITION = ReqDAL.LOID;
                data.REQUISITIONCODE = ReqDAL.CODE;
                data.REQUISITIONTYPE = ReqDAL.REQUISITIONTYPE;
                data.RESERVEDATE = ReqDAL.RESERVEDATE;
                data.REQDATE = ReqDAL.REQDATE;
                DocTypeDAL dDAL = new DocTypeDAL();
                dDAL.GetDataByRequisitionType(data.REQUISITIONTYPE, obj.zTrans);
                data.DOCTYPE = dDAL.LOID;

                obj.zTrans.Commit();
                obj.CloseConnection();
            }
            catch (Exception ex)
            {
                obj.zTrans.Rollback();
                obj.CloseConnection();
                _error = ex.Message;
            }
            return data;
        }
Example #2
0
        public StockOutFGReqData GetRequisitionData(double requisition)
        {
            StockOutFGReqData data = new StockOutFGReqData();
            OracleDBObj obj = new OracleDBObj();
            obj.CreateConnection();
            obj.CreateTransaction();
            try
            {
                ReqDAL.GetDataByLOID(requisition, obj.zTrans);
                data.CADDRESS = ReqDAL.CADDRESS;
                data.CFAX = ReqDAL.CFAX;
                data.CLASTNAME = ReqDAL.CLASTNAME;
                data.CNAME = ReqDAL.CNAME;
                data.CTEL = ReqDAL.CTEL;
                data.CTITLE = ReqDAL.CTITLE;
                data.CUSTOMER = ReqDAL.CUSTOMER;
                data.WAREHOUSE = ReqDAL.WAREHOUSE;
                data.REFWAREHOUSE = ReqDAL.REFWAREHOUSE == 0 ? ReqDAL.WAREHOUSE : ReqDAL.REFWAREHOUSE;
                WarehouseDAL wDAL = new WarehouseDAL();
                wDAL.GetDataByLOID(data.WAREHOUSE, obj.zTrans);
                data.WAREHOUSECODE = wDAL.CODE;
                data.WAREHOUSENAME = wDAL.NAME;
                CustomerDAL cDAL = new CustomerDAL();
                cDAL.GetDataByLOID(data.CUSTOMER, obj.zTrans);
                data.CUSTOMERCODE = cDAL.CODE;
                data.CUSTOMERNAME = (cDAL.NAME + " " + cDAL.LASTNAME).Trim();
                data.REQUISITION = ReqDAL.LOID;
                data.REQUISITIONCODE = ReqDAL.CODE;
                data.REQUISITIONTYPE = ReqDAL.REQUISITIONTYPE;
                data.RESERVEDATE = ReqDAL.RESERVEDATE;
                data.REQDATE = ReqDAL.REQDATE;
                DocTypeDAL dDAL = new DocTypeDAL();
                dDAL.GetDataByRequisitionType(data.REQUISITIONTYPE, obj.zTrans);
                data.DOCTYPE = dDAL.LOID;
                RequisitionItemDAL reqItemDAL = new RequisitionItemDAL();
                DataTable dt = GetProductLot(data.REQUISITION, data.REFWAREHOUSE);
                int i = 1;
                foreach (DataRow dRow in dt.Rows)
                {
                    dRow["NO"] = i;
                    i += 1;
                }
                data.REQUISITIONITEM = dt;

                obj.zTrans.Commit();
                obj.CloseConnection();
            }
            catch (Exception ex)
            {
                obj.zTrans.Rollback();
                obj.CloseConnection();
                _error = ex.Message;
            }
            return data;
        }
Example #3
0
        public StockOutFGReqData GetcustomerData(double requisition)
        { 
                    StockOutFGReqData data = new StockOutFGReqData();
            OracleDBObj obj = new OracleDBObj();
            obj.CreateConnection();
            obj.CreateTransaction();
            try
            {
                ReqDAL.GetDataByLOID(requisition, obj.zTrans);
                data.CADDRESS = ReqDAL.CADDRESS;
                data.CFAX = ReqDAL.CFAX;
                data.CLASTNAME = ReqDAL.CLASTNAME;
                data.CNAME = ReqDAL.CNAME;
                data.CTEL = ReqDAL.CTEL;
                data.CTITLE = ReqDAL.CTITLE;
                data.CUSTOMER = ReqDAL.CUSTOMER;
                data.WAREHOUSE = ReqDAL.WAREHOUSE;
                data.REFWAREHOUSE = ReqDAL.REFWAREHOUSE == 0 ? ReqDAL.WAREHOUSE : ReqDAL.REFWAREHOUSE;
                WarehouseDAL wDAL = new WarehouseDAL();
                wDAL.GetDataByLOID(data.WAREHOUSE, obj.zTrans);
                data.WAREHOUSECODE = wDAL.CODE;
                data.WAREHOUSENAME = wDAL.NAME;
                CustomerDAL cDAL = new CustomerDAL();
                cDAL.GetDataByLOID(data.CUSTOMER, obj.zTrans);
                data.CUSTOMERCODE = cDAL.CODE;
                data.CUSTOMERNAME = (cDAL.NAME + " " + cDAL.LASTNAME).Trim();
                data.REQUISITION = ReqDAL.LOID;
                data.REQUISITIONCODE = ReqDAL.CODE;
                data.REQUISITIONTYPE = ReqDAL.REQUISITIONTYPE;
                data.RESERVEDATE = ReqDAL.RESERVEDATE;
                data.REQDATE = ReqDAL.REQDATE;

            }
            catch (Exception ex)
            {
                obj.zTrans.Rollback();
                obj.CloseConnection();
                _error = ex.Message;
            }
            return data;
        }