private CtrlDeliveryData GetData() { CtrlDeliveryData data = new CtrlDeliveryData(); data.CODE = this.txtCode.Text.Trim(); data.DATEFROM = this.ctlDateFrom.DateValue; data.DATETO = this.ctlDateTo.DateValue; data.CARNO = this.txtCarNo.Text.Trim(); data.DELIVERYNAME = this.txtDeliveryName.Text.Trim(); return data; }
private void SetData(CtrlDeliveryData data) { this.txtLOID.Text = data.LOID.ToString(); this.txtCarNo.Text = data.CARNO; this.ctlDeliveryDate.DateValue = (data.DELIVERYDATE.Year == 1 ? DateTime.Today : data.DELIVERYDATE); this.txtDeliveryName.Text = data.DELIVERYNAME; this.txtCreateBy.Text = (data.CREATEBY == "" ? Authz.CurrentUserInfo.UserID : data.CREATEBY); this.txtCode.Text = data.CODE; this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.ControlTransport, data.LOID) + " return false;"; SetGrvItem(); }
public CtrlDeliveryData GetData(double loid) { CtrlDeliveryData data = new CtrlDeliveryData(); if (DALObj.GetDataByLOID(loid, null)) { data.LOID = DALObj.LOID; data.CODE = DALObj.CODE; data.CREATEBY = DALObj.CREATEBY; data.CARNO = DALObj.CARNO; data.DELIVERYDATE = DALObj.DELIVERYDATE; data.DELIVERYNAME = DALObj.DELIVERYNAME; } return data; }
public bool ValidateData(CtrlDeliveryData data) { bool ret = true; //if (data.DUEDATE.Year == 1) //{ // ret = false; // _error = "¡ÃسҡÓ˹´Çѹ·ÕèºÑ¹·Ö¡ÊÑ觼ÅÔµ"; //} if (data.ITEM.Count == 0) { ret = false; _error = "¡ÃسÒÃкØÃÒ¡Òà Invoice"; } return ret; }
public DataTable GetDeliveryList(CtrlDeliveryData whereData) { string whereString = ""; if (whereData.CODE.Trim() != "") whereString += "AND CODE = '" + OracleDB.QRText(whereData.CODE.Trim()) + "' "; if (whereData.DATEFROM.Year != 1) whereString += "AND RESERVEDATE >= " + OracleDB.QRDate(whereData.DATEFROM) + " "; if (whereData.DATETO.Year != 1) whereString += "AND RESERVEDATE <= " + OracleDB.QRDate(whereData.DATETO) + " "; if (whereData.CARNO.Trim() != "") whereString += "AND CARNO = '" + OracleDB.QRText(whereData.CARNO.Trim()) + "' "; if (whereData.DELIVERYNAME.Trim() != "") whereString += "AND DRIVERNAME = '" + OracleDB.QRText(whereData.DELIVERYNAME.Trim()) + "' "; string sql = "SELECT ROWNUM NO, A.* FROM (SELECT * FROM CTRLDELIVERY ORDER BY CODE) A "; sql += (whereString == "" ? "" : "WHERE " + whereString); sql += "ORDER BY NO "; return OracleDB.ExecListCmd(sql); }
public bool UpdateData(string userID, CtrlDeliveryData data) { bool ret = true; if (ValidateData(data)) { OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { DALObj.GetDataByLOID(data.LOID, obj.zTrans); //DALObj.CODE = data.CODE; DALObj.CARNO = data.CARNO; DALObj.DELIVERYDATE = data.DELIVERYDATE; DALObj.DELIVERYNAME = data.DELIVERYNAME; if (DALObj.OnDB) ret = DALObj.UpdateCurrentData(userID, obj.zTrans); else ret = DALObj.InsertCurrentData(userID, obj.zTrans); _LOID = DALObj.LOID; if (!ret) { throw new ApplicationException(DALObj.ErrorMessage); } CtrlDeliveryItemDAL itemDAL = new CtrlDeliveryItemDAL(); itemDAL.DeleteDataByCtrlDelivery(data.LOID, obj.zTrans); for (Int16 i = 0; i < data.ITEM.Count; ++i) { CtrlDeliveryItemData item = (CtrlDeliveryItemData)data.ITEM[i]; itemDAL.BOXQTY = item.BOXQTY; itemDAL.CADDRESS = item.CADDRESS; itemDAL.CNAME = item.CNAME; itemDAL.CONTACTNAME = item.CONTACTNAME; itemDAL.CTEL = item.CTEL; itemDAL.CTRLDELIVERY = DALObj.LOID; itemDAL.REQUISITION = item.REQUISITION; itemDAL.OnDB = false; ret = itemDAL.InsertCurrentData(userID, obj.zTrans); if (!ret) throw new ApplicationException(itemDAL.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 DataTable GetDeliveryList(CtrlDeliveryData data) { return SearchDAL.GetDeliveryList(data); }
private CtrlDeliveryData GetData() { CtrlDeliveryData data = new CtrlDeliveryData(); data.LOID = Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text); data.CODE = this.txtCode.Text.Trim(); data.CARNO = this.txtCarNo.Text.Trim(); data.DELIVERYDATE = this.ctlDeliveryDate.DateValue; data.DELIVERYNAME = this.txtDeliveryName.Text.Trim(); data.ITEM = ItemObj.GetItemList(); return data; }