public static bool Update_StatusRR(string UserID, PDProductData PdpData, PDOrderData PoData, string PdpLoid, string PoLoid) { bool ret = true; bool rr = true; PDProductDAL pdDAL = new PDProductDAL(); pdDAL.GetDataByLOID(Convert.ToDouble(PdpLoid), null); pdDAL.PRODSTATUS = PdpData.PRODSTATUS; pdDAL.RADIATERETQTY = PdpData.RADIATERETQTY; pdDAL.RADIATERETREMARK = PdpData.RADIATERETREMARK; pdDAL.RADIATERETUNIT = PdpData.RADIATERETUNIT; if (PdpData.RADIATERETDATE.Year.ToString() != "1" || PdpData.RADIATERETDATE.ToString() != "") pdDAL.RADIATERETDATE = PdpData.RADIATERETDATE; ret = pdDAL.UpdateCurrentData(UserID, null); //=========================================================// PDOrderDAL PoDAL = new PDOrderDAL(); PoDAL.GetDataByLOID(Convert.ToDouble(PoLoid), null); string status = PoData.STATUS; PoDAL.STATUS = PoData.STATUS; rr = PoDAL.UpdateCurrentData(UserID, null); if (ret == true && rr == true) return true; else return false; }
public static bool Update_StatusRD(string UserID, PDProductData PdpData, PDOrderData PoData, string PdpLoid, string PoLoid) { bool ret = true; bool rr = true; PDProductDAL pdDAL = new PDProductDAL(); pdDAL.GetDataByLOID(Convert.ToDouble(PdpLoid), null); pdDAL.PRODSTATUS = PdpData.PRODSTATUS; if (PdpData.PRODSTATUS == "QS") { pdDAL.QUARANTINEQTY = PdpData.QUARANTINEQTY; pdDAL.QUARANTINEREMARK = PdpData.QUARANTINEREMARK; if (PdpData.QUARANTINEDATE.Year.ToString() != "1" & PdpData.QUARANTINEDATE.ToString() != "") pdDAL.QUARANTINEDATE = PdpData.QUARANTINEDATE; } else if (PdpData.PRODSTATUS == "RD") { pdDAL.RADIATEQTY = PdpData.RADIATEQTY; pdDAL.RADIATEREMARK = PdpData.RADIATEREMARK; pdDAL.RADIATEUNIT = PdpData.RADIATEUNIT; if (PdpData.RADIATEDATE.Year.ToString() != "1" & PdpData.RADIATEDATE.ToString() != "") pdDAL.RADIATEDATE = PdpData.RADIATEDATE; } else if (PdpData.PRODSTATUS == "AP") { pdDAL.SENDFGREMARK = PdpData.SENDFGREMARK; pdDAL.SENDFGQTY = PdpData.SENDFGQTY; if (PdpData.SENDFGDATE.Year.ToString() != "1" & PdpData.SENDFGDATE.ToString() != "") pdDAL.SENDFGDATE = PdpData.SENDFGDATE; } else if (PdpData.PRODSTATUS == "QC") { if (PdpData.SENDQCDATE.Year.ToString() != "1" & PdpData.SENDQCDATE.ToString() != "") pdDAL.SENDQCDATE = PdpData.SENDQCDATE; } ret = pdDAL.UpdateCurrentData(UserID, null); //=========================================================// PDOrderDAL PoDAL = new PDOrderDAL(); PoDAL.GetDataByLOID(Convert.ToDouble(PoLoid), null); string status = PoData.STATUS; PoDAL.STATUS = PoData.STATUS; rr = PoDAL.UpdateCurrentData(UserID, null); if (status == Constz.Requisition.Status.RW.Code) rr = PoDAL.CutStockQS(Convert.ToDouble(PoLoid), UserID ,null); else if (status == Constz.Requisition.Status.XRay.Code) rr = PoDAL.CutStockItemQS(Convert.ToDouble(PoLoid), UserID, null); else if (status == Constz.Requisition.Status.QC.Code || status == Constz.Requisition.Status.QS.Code) rr = PoDAL.CutStock(Convert.ToDouble(PoLoid), UserID, null); if (ret == true && rr == true) return true; else return false; }
public bool UpdateStockOutStatus(string userID, double stockOut, string status) { bool ret = true; OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { DALObj.OnDB = false; DALObj.GetDataByLOID(stockOut, obj.zTrans); DALObj.STATUS = status; if (DALObj.OnDB) ret = DALObj.UpdateCurrentData(userID, obj.zTrans); if (!ret) throw new ApplicationException(DALObj.ErrorMessage); RequisitionDAL rDAL = new RequisitionDAL(); rDAL.GetDataByLOID(DALObj.REFLOID, obj.zTrans); rDAL.ACTIVE = Constz.ActiveStatus.InActive; if (rDAL.OnDB) ret = rDAL.UpdateCurrentData(userID, obj.zTrans); if (!ret) throw new ApplicationException(rDAL.ErrorMessage); ret = DALItemObj.UpdateStatusByStockOut(stockOut, status, userID, obj.zTrans); if (!ret) throw new ApplicationException(DALItemObj.ErrorMessage); PDProductDAL pdDAL = new PDProductDAL(); pdDAL.GetDataByLOID(rDAL.REFLOID, obj.zTrans); PDOrderDAL poDAL = new PDOrderDAL(); poDAL.GetDataByLOID(pdDAL.PDORDER, obj.zTrans); poDAL.STATUS = Constz.Requisition.Status.RW.Code; ret = poDAL.UpdateCurrentData(userID, obj.zTrans); if (!ret) throw new ApplicationException(poDAL.ErrorMessage); ret = DALObj.CutStock(stockOut, userID, obj.zTrans); if (!ret) throw new ApplicationException(DALObj.ErrorMessage); obj.zTrans.Commit(); obj.CloseConnection(); } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; _error = ex.Message; } return ret; }
public static bool UpdatePdOrder(string UserID, PDOrderData data,double PoLoid) { PDOrderDAL poDAL = new PDOrderDAL(); poDAL.GetDataByLOID(PoLoid, null); poDAL.REMARK = data.REMARK; poDAL.SUPPLIER = Constz.ProductionDepartment.LOID; bool ret = poDAL.UpdateCurrentData(UserID, null); return ret; }
public bool UpdateData(string userID, StockinQCData data) { bool ret = true; if (ValidateData(data)) { OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { DALObj.OnDB = false; DALObj.GetDataByLOID(data.LOID, obj.zTrans); data.PDORDERLOID= DALObj.PDORDER ; PDOrderDAL PDDAL = new PDOrderDAL(); PDDAL.GetDataByLOID(data.PDORDERLOID, null); PDDAL.ANACODE = data.ANACODE; PDDAL.ANADATE = data.ANADATE; if (PDDAL.OnDB) ret = PDDAL.UpdateCurrentData(userID, obj.zTrans); else ret = PDDAL.InsertCurrentData(userID, obj.zTrans); _LOID = PDOrderDALObj.LOID; if (!ret) { throw new ApplicationException(PDOrderDALObj.ErrorMessage); } obj.zTrans.Commit(); obj.CloseConnection(); } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; _error = ex.Message; } } else ret = false; return ret; }