private void SetData(StockinProductData data) { this.txtLotNoFrom.Text = data.LOTNO; this.txtLotNoTo.Text = data.LOTNO; this.txtProductName.Text = data.PRODUCTNAME; this.PDDateFrom.DateValue = data.MFGDATE; this.PDDateTo.DateValue = data.MFGDATE; SearchData(); }
private bool VeridateData(StockinProductData data) { bool ret = true; if (data.LOTNO.Trim() == "") { ret = false; _error = "¡ÃسÒÃкØàÅ¢·Õè¡ÒüÅÔµ"; } else if (data.PRODUCTNAME.Trim() == "") { ret = false; _error = "¡ÃسÒÃкت×èͼÅÔµÀѳ±ì"; } return ret; }
public StockinProductData GetData(double loid) { StockinProductData data = new StockinProductData(); if (DALObj.GetDataByLOID(loid, null)) { data.PRODUCTNAME = DALObj.PRODUCTNAME; data.LOTNO = DALObj.LOTNO; data.LOID = DALObj.LOID; data.MFGDATE = DALObj.MFGDATE; data.PDQTY = DALObj.PDQTY; data.PRODUCT = DALObj.PRODUCT; data.UNIT = DALObj.UNIT; data.PDPRODUCT = DALObj.LOID; } return data; }
public bool UpdateData(string userID,StockinProductData data) { bool ret = true; if (VeridateData(data)) { OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { DALObj.GetDataByLOID(data.LOID, obj.zTrans); DALObj.LOID = data.LOID; DALObj.PRODUCT = data.PRODUCT; DALObj.UNIT = data.UNIT; DALObj.LOID = data.PDPRODUCT; DALObj.LOTNO = data.LOTNO.Trim(); DALObj.PRODUCTNAME = data.PRODUCTNAME.Trim(); if (DALObj.OnDB) ret = DALObj.UpdateCurrentData(userID, obj.zTrans); else ret = DALObj.InsertCurrentData(userID, obj.zTrans); if (ret) { obj.zTrans.Commit(); obj.CloseConnection(); } else { throw new ApplicationException(DALObj.ErrorMessage); } } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; _error = ex.Message; } } else ret = false; return ret; }
private void SetData(StockinProductData data) { if (data.LOID == 0) { data.CREATEBY = Authz.CurrentUserInfo.UserID; data.ACTIVE = Constz.ActiveStatus.Active; data.CODE = ""; data.STCREATEON = DateTime.Now.Date; data.STATUS = Constz.Requisition.Status.Waiting.Code; } this.txtLOID.Text = data.LOID.ToString(); this.txtStatus.Text = data.STATUS; this.txtSender.Text = ""; this.txtSenderCode.Text = ""; this.txtSenderName.Text = Constz.ProductionDepartment.Name; this.txtStockinCode.Text = data.CODE; this.ctlReserveDate.DateValue = data.STCREATEON; this.txtRemark.Text = data.REMARK; this.txtStatusName.Text = (data.STATUS == Constz.Requisition.Status.Approved.Code ? Constz.Requisition.Status.Approved.Name : (data.STATUS == Constz.Requisition.Status.Void.Code ? Constz.Requisition.Status.Void.Name : (data.STATUS == Constz.Requisition.Status.Finish.Code ? Constz.Requisition.Status.Finish.Name : Constz.Requisition.Status.Waiting.Name))); SetToolbar(data.STATUS); SetGrvItem(data.STATUS); if (data.STATUS != Constz.Requisition.Status.Waiting.Code) { this.ctlToolbar.BtnSaveShow = false; this.ctlToolbar.BtnCancelShow = false; if (data.STATUS == Constz.Requisition.Status.QC.Code || data.STATUS == Constz.Requisition.Status.Finish.Code) { this.ctlToolbar.BtnSubmitShow = false; } } string producetype = Request["producetype"]; if (producetype == Constz.ProductType.Type.WH.Code) this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.StockinProductWH, Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text)) + " return false;"; else this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.StockInProduction, Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text)) + " return false;"; }
private void UpdateData(string userID, StockinProductData data, System.Data.OracleClient.OracleTransaction zTrans) { bool ret = true; SDAL.OnDB = false; SDAL.GetDataByLOID(data.LOID, zTrans); SDAL.SENDER = data.SENDER; SDAL.RECEIVER = data.RECEIVER; if (SDAL.RECEIVEDATE.Year == 1) SDAL.RECEIVEDATE = DateTime.Today; //SDAL.CREATEON = data.STCREATEON; SDAL.REMARK = data.REMARK; SDAL.STATUS = data.STATUS; SDAL.DOCTYPE = data.DOCTYPE; if (SDAL.OnDB) ret = SDAL.UpdateCurrentData(userID, zTrans); else ret = SDAL.InsertCurrentData(userID, zTrans); _LOID = SDAL.LOID; if (!ret) { throw new ApplicationException(SDAL.ErrorMessage); } StockInItemDAL itemDAL = new StockInItemDAL(); itemDAL.DeleteDataByStockIn(data.LOID, zTrans); for (Int16 i = 0; i < data.ITEM.Count; ++i) { StockinProductData item = (StockinProductData)data.ITEM[i]; itemDAL.PRODUCT = item.PRODUCT; itemDAL.QTY = item.QTY; itemDAL.STOCKIN = SDAL.LOID; itemDAL.REFLOID = item.REFLOID; itemDAL.REFTABLE = "PDPRODUCT"; itemDAL.LOTNO = item.LOTNO; itemDAL.ACTIVE = Constz.ActiveStatus.Active; itemDAL.STATUS = Constz.Requisition.Status.Waiting.Code; itemDAL.UNIT = item.UNIT; itemDAL.OnDB = false; ret = itemDAL.InsertCurrentData(userID, zTrans); if (!ret) throw new ApplicationException(SDAL.ErrorMessage); } }
public bool ValidateData(StockinProductData data) { bool ret = true; //if (Convert.ToDouble(data.LOTNO) == 0) //{ // ret = false; // _error = "¡ÃسÒÃкØàÅ¢·Õè¡ÒüÅÔµ"; //} //else if (data.REQDATE.Year == 1) //{ // ret = false; // _error = "¡ÃسÒÇѹ·ÕèºÑ¹·Ö¡ÃÒ¡ÒÃ"; //} //else if (data.REASON == "") //{ // ret = false; // _error = "¡ÃسÒÃкØà˵ؼÅ㹡Òâͫ×éÍ"; //} if (data.ITEM.Count == 0) { ret = false; _error = "¡ÃسÒÃкØÃÒ¡ÒÃÊÔ¹¤éÒ"; } return ret; }
public StockinProductData GetData1(double loid) { StockinProductData data = new StockinProductData(); //if (SearchDAL.GetDataByLOID(loid, null)) //{ // data.LOTNO = SearchDAL.LOTNO; // data.PDBARCODE = SearchDAL.PDBARCODE; // data.PDNAME = SearchDAL.PDNAME; // data.BATCHSIZE = SearchDAL.BATCHSIZE; // data.BATCHSIZEUNITNAME = SearchDAL.BATCHSIZEUNITNAME; //} return data; }
public StockinProductData GetData(double loid) { StockinProductData data = new StockinProductData(); if (SDAL.GetDataByLOID(loid, null)) { data.LOID = SDAL.LOID; data.CODE = SDAL.CODE; data.SENDER = SDAL.SENDER; data.REMARK = SDAL.REMARK; data.STCREATEON = SDAL.CREATEON; data.STATUS = SDAL.STATUS; } return data; }
public StockinProductData GetDataLotNo1(string code) { StockinProductData data = new StockinProductData(); //if (SearchDAL.GetDataByLOTNO(code, null)) //{ // data.LOTNO = SearchDAL.LOTNO; // data.PDBARCODE = SearchDAL.PDBARCODE; // data.PDNAME = SearchDAL.PDNAME; // data.BATCHSIZE = SearchDAL.BATCHSIZE; // data.BATCHSIZEUNITNAME = SearchDAL.BATCHSIZEUNITNAME; //} return data; }
public StockinProductData GetDataLotNo(string code) { StockinProductData data = new StockinProductData(); //if (SDAL.GetDataByLOTNO(code, null)) //{ // data.REQDATE = DALObj.REQDATE; // data.CODE = DALObj.CODE; // data.CREATEBY = DALObj.CREATEBY; // //data.STATUS = DALObj.STATUS; // data.REMARK = DALObj.REMARK; // data.LOTNO = DALObj.LOTNO; // data.WAREHOUSE = DALObj.WAREHOUSE; //} return data; }
private bool VerifyData(StockinProductData data) { bool ret = true; if (data.LOTNO.Trim() == "") { ret = false; _error = "¡ÃسÒàÅ×Í¡àÅ¢·Õè¡ÒüÅÔµ"; } else if (data.QTY == 0) { ret = false; _error = "¡ÃسÒÃкبӹǹÃѺ"; } else { DataTable dt = (DataTable)System.Web.HttpContext.Current.Session[sessionName]; foreach (DataRow dRow in dt.Rows) { if (Convert.ToString(dRow["LOTNO"]) == data.LOTNO && Convert.ToDouble(dRow["LOID"]) != data.LOID) { _error = "àÅ¢·Õè¡ÒüÅÔµ¹ÕéÁÕÍÂÙèã¹ÃÒ¡ÒÃáÅéÇ"; ret = false; goto ex; } } ex: ; } return ret; }
protected void grvItem_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Insert") { TextBox txtProduct = (TextBox)this.grvItem.FooterRow.Cells[4].FindControl("txtNewProduct"); TextBox txtQty = (TextBox)this.grvItem.FooterRow.Cells[6].FindControl("txtNewQty"); TextBox txtBarCode = (TextBox)this.grvItem.FooterRow.Cells[2].FindControl("txtNewBarCode"); TextBox txtProductName = (TextBox)this.grvItem.FooterRow.Cells[4].FindControl("txtNewProduct"); TextBox txtUnitName = (TextBox)this.grvItem.FooterRow.Cells[7].FindControl("txtNewUnit"); TextBox txtUnit = (TextBox)this.grvItem.FooterRow.Cells[7].FindControl("txtNewUnit"); TextBox txtRefLoid = (TextBox)this.grvItem.FooterRow.Cells[2].FindControl("txtRefLoid"); TextBox txtProductLOID = (TextBox)grvItem.FooterRow.Cells[2].FindControl("txtProductLOID"); TextBox txtUnitLOID = (TextBox)grvItem.FooterRow.Cells[2].FindControl("txtUnitLOID"); TextBox txtPDPLOID = (TextBox)grvItem.FooterRow.Cells[2].FindControl("txtPDPLOID"); TextBox txtMFGDate = (TextBox)grvItem.FooterRow.Cells[3].FindControl("txtNewMfgdate"); TextBox txtPDQty = (TextBox)this.grvItem.FooterRow.Cells[5].FindControl("txtNewPDQTY"); StockinProductData data = new StockinProductData(); //data.PRODUCT = Convert.ToDouble(cmbProduct.SelectedItem.Value); data.QTY = Convert.ToDouble(txtQty.Text == "" ? "0" : txtQty.Text); data.LOTNO = txtBarCode.Text.Trim(); data.REFLOID = Convert.ToDouble(txtRefLoid.Text == "" ? "0" : txtRefLoid.Text); data.PRODUCT = Convert.ToDouble("0" + txtProductLOID.Text); data.UNIT = Convert.ToDouble("0" + txtUnitLOID.Text); data.PDPRODUCT = Convert.ToDouble("0" + txtPDPLOID.Text); data.PRODUCTNAME = txtProductName.Text.Trim(); data.UNITNAME = txtUnitName.Text.Trim(); data.MFGDATE = Convert.ToDateTime(txtMFGDate.Text == "" ? new DateTime(1, 1, 1).ToString() : txtMFGDate.Text); data.PDQTY = Convert.ToDouble(txtPDQty.Text == "" ? "0" : txtPDQty.Text); if (ItemObj.InsertStokInItem(data)) { SetGrvItem(this.txtStatus.Text); } else Appz.ClientAlert(this, ItemObj.ErrorMessage); } }
private StockinProductData GetData() { StockinProductData data = new StockinProductData(); data.LOID = Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text); data.ACTIVE = Constz.ActiveStatus.Active; data.CODE = this.txtCode.Text; data.SENDER = Convert.ToDouble(this.txtSender.Text == "" ? "0" : this.txtSender.Text); data.RECEIVER = Authz.CurrentUserInfo.Warehouse; data.ITEM = ItemObj.GetItemList(); data.REMARK = this.txtRemark.Text.Trim(); data.STCREATEON = this.ctlReserveDate.DateValue; data.STATUS = this.txtStatus.Text.Trim(); data.DOCTYPE = Constz.DocType.DelProduct.LOID; return data; }
public bool UpdateStockInItem(decimal LOID, decimal PDQTY, decimal QTY, DateTime MFGDATE, string UNITNAME, decimal UNIT, decimal PRODUCT, decimal PDPLOID, string PRODUCTNAME, string LOTNO, decimal RANK, decimal REFLOID) { StockinProductData data = new StockinProductData(); data.LOID = Convert.ToDouble(LOID); data.LOTNO = Convert.ToString(LOTNO); data.MFGDATE = Convert.ToDateTime(MFGDATE); data.PRODUCTNAME = Convert.ToString(PRODUCTNAME); data.PDQTY = Convert.ToDouble(PDQTY); data.QTY = Convert.ToDouble(QTY); data.REFLOID = Convert.ToDouble(REFLOID); data.UNITNAME = Convert.ToString(UNITNAME); data.PRODUCT = Convert.ToDouble(PRODUCT); data.UNIT = Convert.ToDouble(UNIT); data.PDPRODUCT = Convert.ToDouble(PDPLOID); bool ret = true; ret = VerifyData(data); if (ret) { DataTable dt = (DataTable)System.Web.HttpContext.Current.Session[sessionName]; if (dt != null) { DataRow[] dRows = dt.Select("LOID = " + data.LOID.ToString()); DataRow dRow = dRows[0]; dRow["PRODUCTNAME"] = data.PRODUCTNAME; // dRow["PRODUCTNAME"] = FlowObj.GetUnitData(data.PRODUCT).NAME; dRow["QTY"] = data.QTY; dRow["PDQTY"] = data.PDQTY; dRow["LOTNO"] = data.LOTNO; dRow["REFLOID"] = data.REFLOID; dRow["MFGDATE"] = data.MFGDATE; dRow["UNITNAME"] = data.UNITNAME; dRow["UNITNAME"] = FlowObj.GetUnitData(data.UNIT).NAME; ReOrder(dt); System.Web.HttpContext.Current.Session[sessionName] = dt; } } else throw new ApplicationException(_error); return ret; }
public ArrayList GetItemList() { DataTable dt = (DataTable)System.Web.HttpContext.Current.Session[sessionName]; ArrayList arr = new ArrayList(); if (dt != null) { foreach (DataRow dRow in dt.Rows) { StockinProductData data = new StockinProductData(); data.ACTIVE = Constz.ActiveStatus.Active; data.LOID = Convert.ToDouble(dRow["LOID"]); data.LOTNO = Convert.ToString(dRow["LOTNO"]); data.MFGDATE = (Convert.IsDBNull(dRow["MFGDATE"]) ? new DateTime(): Convert.ToDateTime(dRow["MFGDATE"])); data.PRODUCT = Convert.ToDouble(dRow["PRODUCT"]); data.PRODUCTNAME = Convert.ToString(dRow["PRODUCTNAME"]); data.PRODUCT = Convert.ToDouble(dRow["PRODUCT"]); data.QTY = Convert.ToDouble(dRow["QTY"]); data.PDQTY = (Convert.IsDBNull(dRow["PDQTY"]) ? new double() : Convert.ToDouble(dRow["PDQTY"])); data.UNITNAME = Convert.ToString(dRow["UNITNAME"]); data.UNIT = Convert.ToDouble(dRow["UNIT"]); data.PDPRODUCT = Convert.ToDouble(dRow["PDPLOID"]); data.REFLOID = Convert.ToDouble(dRow["REFLOID"]); arr.Add(data); } } return arr; }
//0 LOID, 0 PRODUCT, 0 QTY, 0 UNIT, 0 PRICE, 0 DISCOUNT, 0 NETPRICE, '" + Constz.ActiveStatus.Active + "' ACTIVE, '' BARCODE, '' UNITNAME, '' ISVAT "; public bool InsertStokInItem(StockinProductData data) { bool ret = true; ret = VerifyData(data); if (ret) { DataTable dt = (DataTable)System.Web.HttpContext.Current.Session[sessionName]; if (dt != null) { ReOrder(dt); DataRow dRow = dt.NewRow(); dRow["LOID"] = Convert.ToDouble(dt.Rows.Count) + 1; dRow["RANK"] = Convert.ToDouble(dRow["LOID"]); dRow["QTY"] = Convert.ToDouble(data.QTY); dRow["PDQTY"] = Convert.ToDouble(data.PDQTY); dRow["UNITNAME"] = data.UNITNAME; //dRow["ACTIVE"] = Constz.ActiveStatus.Active; dRow["UNIT"] = Convert.ToDouble(data.UNIT); dRow["PDPLOID"] = Convert.ToDouble(data.PDPRODUCT); dRow["PRODUCT"] = Convert.ToDouble(data.PRODUCT); dRow["PRODUCTNAME"] = data.PRODUCTNAME; dRow["MFGDATE"] = Convert.ToDateTime(data.MFGDATE); dRow["LOTNO"] = data.LOTNO; dRow["REFLOID"] = Convert.ToDouble(data.REFLOID); dt.Rows.Add(dRow); System.Web.HttpContext.Current.Session[sessionName] = dt; } } return ret; }
public bool CommitQCData(string userID, StockinProductData data) { bool ret = true; if (ValidateData(data)) { OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { UpdateData(userID, data, obj.zTrans); ret = SDAL.CutStock(_LOID, userID, obj.zTrans); if (!ret) throw new ApplicationException(SDAL.ErrorMessage); obj.zTrans.Commit(); obj.CloseConnection(); } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; _error = ex.Message; } } else ret = false; return ret; }
public StockinProductData GetAllData(double loid) { // Get Old Data From Requisition StockinProductData data = new StockinProductData(); if (SDAL.GetDataByLOID(loid, null)) { //data.STCREATEON = DALObj.; //data.CODE = DALObj.CODE; //data.CREATEBY = DALObj.CREATEBY; //data.STATUS = DALObj.STATUS; //data.REMARK = DALObj.REMARK; //data.LOTNO = DALObj.LOTNO; //data.WAREHOUSE = DALObj.WAREHOUSE; //data.LOTNO = DALObj.LOTNO; //PDReserveData data2 = GetPDDataFromLOT(data.LOTNO); //data.PDBARCODE = data2.PDBARCODE; //data.PDNAME = data2.PDNAME; //data.BATCHSIZE = data2.BATCHSIZE; //data.BATCHSIZEUNITNAME = data2.BATCHSIZEUNITNAME; } return data; }
public StockinProductData GetPDDataFromLOT(string LotNo) { // Get Master Data From BOM List.. StockinProductData data = new StockinProductData(); //if (SearchDAL.GetDataByLOTNO(LotNo, null)) //{ // data.VPLOID = SearchDAL.PDLOID; // data.LOTNO = SearchDAL.LOTNO; // data.PDBARCODE = SearchDAL.PDBARCODE; // data.PDNAME = SearchDAL.PDNAME; // data.BATCHSIZE = SearchDAL.BATCHSIZE; // data.BATCHSIZEUNITNAME = SearchDAL.BATCHSIZEUNITNAME; //} return data; }