예제 #1
0
 public ProductOrderData GetData(double loid)
 {
     ProductOrderData data = new ProductOrderData();
     if (DALObj.GetDataByLOID(loid, null))
     {
         data.LOID = DALObj.LOID;
         data.ACTIVE = DALObj.ACTIVE;
         data.CODE = DALObj.CODE;
         data.CREATEBY = DALObj.CREATEBY;
         data.CUSTOMER = DALObj.CUSTOMER;
         data.REMARK = DALObj.REMARK;
         data.RESERVEDATE = DALObj.RESERVEDATE;
         data.REQUISITIONTYPE = DALObj.REQUISITIONTYPE;
         data.STATUS = DALObj.STATUS;
         data.TOTAL = DALObj.TOTAL;
         data.WAREHOUSE = DALObj.WAREHOUSE;
         data.REFWAREHOUSE = DALObj.REFWAREHOUSE;
         data.TOTDIS = DALObj.TOTDIS;
         data.TOTVAT = DALObj.TOTVAT;
         data.GRANDTOT = DALObj.GRANDTOT;
         WarehouseDAL itemDAL = new WarehouseDAL();
         itemDAL.GetDataByLOID(DALObj.WAREHOUSE, null);
         data.WAREHOUSENAME = itemDAL.NAME;
     }
     return data;
 }
예제 #2
0
        private string GenNewBatchNo(double warehouse, System.Data.OracleClient.OracleTransaction trans )
        {
            string last = "00001";
            string sql = "SELECT NVL(MAX(LOID),0) FROM STOCKCHECK ";
            DataTable dt = OracleDB.ExecListCmd(sql, trans);
            if (dt.Rows.Count != 0)
            {
                last = String.Format("{0:00000}", Convert.ToInt32(dt.Rows[0][0]) + 1);
                if (last.Length > 5)
                {
                    last = last.Substring(0, last.Length - 5);
                }
            }

            WarehouseDAL wDAL = new WarehouseDAL();
            wDAL.GetDataByLOID(warehouse, trans);

            return String.Format(wDAL.CODE + "{0:yyMM}", DateTime.Now) + last;
            //return OracleDB.GetRunningCode("STOCKCHECK", "STOCKCHECK");
        }
예제 #3
0
 public static string GetWarehouseName(string WHLoid)
 {
     WarehouseDAL wDAL = new WarehouseDAL();
     wDAL.GetDataByLOID(Convert.ToDouble(WHLoid == "" ? "0" : WHLoid), null);
     return wDAL.NAME;
 }
예제 #4
0
    private void SetData(ProductOrderData data)
    {
        if (data.LOID == 0)
        {
            data.STATUS = Constz.Requisition.Status.Waiting.Code;
            data.CREATEBY = Authz.CurrentUserInfo.UserID;
            data.WAREHOUSE = Authz.CurrentUserInfo.Warehouse;
            data.RESERVEDATE = DateTime.Today;
            data.REFWAREHOUSE = Constz.ReadyMadeDepartment.LOID;
            WarehouseDAL itemDAL = new WarehouseDAL();
            itemDAL.GetDataByLOID(Authz.CurrentUserInfo.Warehouse, null);
            data.WAREHOUSENAME = itemDAL.NAME;
        }
        this.txtLOID.Text = data.LOID.ToString();
        this.txtStatus.Text = data.STATUS;
        this.txtRequisitionCode.Text = data.CODE;
        this.ctlReqDate.DateValue = data.RESERVEDATE.Year == 1 ? DateTime.Now : data.RESERVEDATE;
        this.txtTotal.Text = data.TOTAL.ToString(Constz.DblFormat);
        this.txtRemark.Text = data.REMARK;
        this.txtCreateBy.Text = data.CREATEBY;
        this.txtStatusName.Text = Appz.GetStatusName(data.STATUS);
        this.txtWarehouse.Text = data.WAREHOUSE.ToString();
        this.cmbRefWarehouse.SelectedIndex = this.cmbRefWarehouse.Items.IndexOf(this.cmbRefWarehouse.Items.FindByValue(data.REFWAREHOUSE.ToString()));
        this.txtCustomer.Text = data.CUSTOMER.ToString();
        this.txtWarehouseName.Text = data.WAREHOUSENAME;
        this.txtTotal.Text = data.TOTAL.ToString(Constz.DblFormat);
        this.txtTotalDiscount.Text = data.TOTDIS.ToString(Constz.DblFormat);
        this.txtVat.Text = data.VAT.ToString();
        this.txtTotalVat.Text = data.TOTVAT.ToString(Constz.DblFormat);
        this.txtGrandTotal.Text = data.GRANDTOT.ToString(Constz.DblFormat);
        this.txtNet.Text = data.GRANDTOT.ToString(Constz.IntFormat);
        //if (this.cmbRefWarehouse.SelectedItem.Value == "0")
        //{
        //    data.REFWAREHOUSE = Constz.ReadyMadeDepartment.LOID;
        //    this.cmbRefWarehouse.SelectedIndex = this.cmbRefWarehouse.Items.IndexOf(this.cmbRefWarehouse.Items.FindByValue(data.REFWAREHOUSE.ToString()));
        //}

        SetGrvItem(data.STATUS);

        if (data.STATUS == Constz.Requisition.Status.Approved.Code || data.STATUS == Constz.Requisition.Status.Void.Code)
        {
            this.ctlToolbar.BtnSaveShow = false;
            this.ctlToolbar.BtnCancelShow = false;
            this.ctlToolbar.BtnSubmitShow = false;
        }
        this.grvItem.Columns[indexCHECk].Visible = (data.STATUS == Constz.Requisition.Status.Waiting.Code);
        this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.ProductRequestInShop, data.LOID) + " return false; ";
        this.ctlToolbarItem.Visible = (data.STATUS == Constz.Requisition.Status.Waiting.Code);
    }
예제 #5
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;
        }
예제 #6
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;
        }