Esempio n. 1
0
 public StockInShopData GetStockOutData(string requisitionCode, double currentStockIn)
 {
     double stockOut = 0;
     ABB.Data.Search.StockOutProductSearchData searchData = new ABB.Data.Search.StockOutProductSearchData();
     searchData.REQUISITIONCODEFROM = requisitionCode;
     searchData.REQUISITIONCODETO = requisitionCode;
     DataTable dtSearch = GetStockOutList(searchData, currentStockIn);
     if (dtSearch.Rows.Count == 1)
     {
         stockOut = Convert.ToDouble(dtSearch.Rows[0]["STOCKOUT"]);
     }
     StockInShopData data = new StockInShopData();
     StockOutDAL sDAL = new StockOutDAL();
     sDAL.TableName = "STOCKOUT" + Constz.ABBSERV + "";
     sDAL.GetDataByLOID(stockOut, null);
     data.CODE = sDAL.CODE;
     data.RECEIVER = sDAL.RECEIVER;
     data.REFLOID = sDAL.LOID;
     data.SENDER = sDAL.RECEIVER;
     RequisitionDAL rDAL = new RequisitionDAL();
     rDAL.TableName = "REQUISITION" + Constz.ABBSERV + "";
     rDAL.GetDataByLOID(sDAL.REFLOID, null);
     data.REQUISITIONCODE = rDAL.CODE;
     DataTable dt = SearchObj.GetStockOutProductList(stockOut);
     int i = 1;
     foreach (DataRow dRow in dt.Rows)
     {
         dRow["ORDERNO"] = i;
         i += 1;
     }
     data.ITEM = dt;
     return data;
 }
Esempio n. 2
0
 public StockInShopData GetStockInData(double stockIn)
 {
     StockInShopData data = new StockInShopData();
     DALObj.GetDataByLOID(stockIn, null);
     data.CODE = DALObj.CODE;
     data.CREATEBY = DALObj.CREATEBY;
     data.GRANDTOT = DALObj.GRANDTOT;
     data.LOID = DALObj.LOID;
     data.RECEIVEDATE = DALObj.RECEIVEDATE;
     data.RECEIVER = DALObj.RECEIVER;
     data.REFLOID = DALObj.REFLOID;
     data.REMARK = DALObj.REMARK;
     data.SENDER = DALObj.SENDER;
     data.STATUS = DALObj.STATUS;
     data.REQUISITIONCODE = DALObj.REFCODE;
     //StockOutDAL sDAL = new StockOutDAL();
     //sDAL.TableName = "STOCKOUT" + Constz.ABBSERV + "";
     //sDAL.GetDataByLOID(DALObj.REFLOID, null);
     //RequisitionDAL rDAL = new RequisitionDAL();
     //rDAL.TableName = "REQUISITION" + Constz.ABBSERV + "";
     //rDAL.GetDataByLOID(sDAL.REFLOID, null);
     //data.REQUISITIONCODE = rDAL.CODE;
     DataTable dt = SearchObj.GetStockInProductList(stockIn);
     int i = 1;
     foreach (DataRow dRow in dt.Rows)
     {
         dRow["ORDERNO"] = i;
         i += 1;
     }
     data.ITEM = dt;
     return data;
 }
Esempio n. 3
0
 public StockInShopData GetStockOutData(double stockOut)
 {
     StockInShopData data = new StockInShopData();
     StockOutDAL sDAL = new StockOutDAL();
     sDAL.TableName = "STOCKOUT" + Constz.ABBSERV + "";
     sDAL.GetDataByLOID(stockOut, null);
     data.CODE = sDAL.CODE;
     data.RECEIVER = sDAL.RECEIVER;
     data.REFLOID = sDAL.LOID;
     data.SENDER = sDAL.RECEIVER;
     RequisitionDAL rDAL = new RequisitionDAL();
     rDAL.TableName = "REQUISITION" + Constz.ABBSERV + "";
     rDAL.GetDataByLOID(sDAL.REFLOID, null);
     data.REQUISITIONCODE = rDAL.CODE;
     DataTable dt = SearchObj.GetStockOutProductList(stockOut);
     int i = 1;
     foreach (DataRow dRow in dt.Rows)
     {
         dRow["ORDERNO"] = i;
         i += 1;
     }
     data.ITEM = dt;
     return data;
 }
Esempio n. 4
0
        private void SetData(StockInShopData data)
        {
            this.txtRequisitionCode.Text = data.REQUISITIONCODE;
            this.txtLOID.Text = data.LOID.ToString();
            this.txtReceiver.Text = "3";
            this.txtSender.Text = "1";
            this.txtStatus.Text = data.STATUS;
            this.txtCode.Text = data.CODE;
            this.txtReceiveDate.Text = data.RECEIVEDATE.ToString(Constz.DateFormat);
            this.dtpReceiveDate.Value = data.RECEIVEDATE;
            this.txtCreateBy.Text = data.CREATEBY;
            this.txtGrandTot.Text = data.GRANDTOT.ToString(Constz.DblFormat);
            this.txtRemark.Text = data.REMARK;

            this.grvStockin.Rows.Clear();
            for (int i = 0; i < data.ITEM.Rows.Count; ++i)
            {
                DataRow itemRow = data.ITEM.Rows[i];
                DataGridViewRow gRow = (DataGridViewRow)this.grvStockin.Rows[this.grvStockin.NewRowIndex].Clone();
                gRow.Cells[indexPRODUCT].Value = Convert.ToDouble(itemRow["PRODUCT"]);
                gRow.Cells[indexUNIT].Value = Convert.ToDouble(itemRow["UNIT"]);
                gRow.Cells[indexORDERNO].Value = i + 1;
                gRow.Cells[indexBARCODE].Value = itemRow["BARCODE"].ToString();
                gRow.Cells[indexNAME].Value = itemRow["NAME"].ToString();
                gRow.Cells[indexQTY].Value = Convert.ToDouble(itemRow["QTY"]);
                gRow.Cells[indexUNITNAME].Value = itemRow["UNITNAME"].ToString();
                gRow.Cells[indexPRICE].Value = Convert.ToDouble(itemRow["PRICE"]);
                gRow.Cells[indexNETPRICE].Value = Convert.ToDouble(itemRow["PRICE"]) * Convert.ToDouble(itemRow["QTY"]);

                gRow.Cells[indexORDERNO].ReadOnly = true;
                gRow.Cells[indexNAME].ReadOnly = true;
                gRow.Cells[indexUNITNAME].ReadOnly = true;
                gRow.Cells[indexPRICE].ReadOnly = true;
                gRow.Cells[indexNETPRICE].ReadOnly = true;
                this.grvStockin.Rows.Add(gRow);
            }
            if (data.STATUS != Constz.Requisition.Status.Waiting.Code)
            {
                this.btnSave.Visible = false;
                this.btnSubmit.Visible = false;
                this.txtRequisitionCode.ReadOnly = true;
                this.txtRequisitionCode.Enabled = false;
                Appz.FormatDataGridView(this.grvStockin, false, false, true);
                this.grvStockin.Columns[indexSEARCH].Visible = false;
            }
            else
            {
                Appz.FormatDataGridView(this.grvStockin, true, true, false);
            }

        }