public PlanData GetPlanData(double plan) { PlanData data = new PlanData(); DALObj.GetDataByLOID(plan, null); data.ACTIVE = DALObj.ACTIVE; data.CODE = DALObj.CODE; data.CONFIRMDATE = DALObj.CONFIRMDATE; data.CREATEBY = DALObj.CREATEBY; data.CREATEON = DALObj.CREATEON; data.DESCRIPTION = DALObj.DESCRIPTION; data.LOID = plan; data.PLANTYPE = DALObj.PLANTYPE; data.STATUS = DALObj.STATUS; data.YEAR = DALObj.YEAR; return data; }
private void SetPlanData(PlanData data) { this.ctlToolbar.BtnCancelShow = (data.STATUS == Constz.Requisition.Status.Approved.Code); this.btnCalculate.Visible = (data.YEAR == (DateTime.Today.Year + 543).ToString() && data.STATUS == Constz.Requisition.Status.Waiting.Code); this.txtPlan.Text = data.LOID.ToString(); this.txtCode.Text = data.CODE; this.txtYear.Text = data.YEAR; this.txtCreateOn.Text = data.CREATEON.ToString(Constz.DateFormat); if (data.CONFIRMDATE.Year != 1) this.txtConfirmDate.Text = data.CONFIRMDATE.ToString(Constz.DateFormat); this.txtDescription.Text = data.DESCRIPTION; this.txtStatus.Text = Appz.GetStatusName(data.STATUS); ComboSource.BuildCombo(this.cmbProductType, "PRODUCTTYPE", "NAME", "LOID", "NAME", "ACTIVE = '" + Constz.ActiveStatus.Active + "' AND TYPE = '" + Constz.ProductType.Type.WH.Code + "' ", "·Ñé§ËÁ´", "0"); SetProductGroup(); SetGridView(); }
protected void NewClick(object sender, EventArgs e) { string[] ret = this.txtNewLOID.Text.Split('#'); try { PlanData data = new PlanData(); data.ACTIVE = Constz.ActiveStatus.InActive; data.DESCRIPTION = ret[1]; data.PLANTYPE = Constz.PlanType.WH; data.STATUS = Constz.Requisition.Status.Waiting.Code; data.YEAR = ret[0]; if (FlowObj.InsertPlan(Authz.CurrentUserInfo.UserID, data)) Response.Redirect(Constz.HomeFolder + "WH/Transaction/Plan.aspx?loid=" + FlowObj.LOID.ToString()); else Appz.ClientAlert(this, FlowObj.ErrorMessage); } catch (Exception ex) { Appz.ClientAlert(this, ex.Message); } }
public bool InsertPlan(string userID, PlanData data) { bool ret = true; OracleDBObj obj = new OracleDBObj(); obj.CreateConnection(); obj.CreateTransaction(); try { if (!DALObj.IsDuplicateData(data.YEAR, data.PLANTYPE, obj.zTrans)) { _DAL = new PlanDAL(); DALObj.OnDB = false; DALObj.ACTIVE = data.ACTIVE; DALObj.DESCRIPTION = data.DESCRIPTION; DALObj.PLANTYPE = data.PLANTYPE; DALObj.STATUS = data.STATUS; DALObj.YEAR = data.YEAR; ret = DALObj.InsertCurrentData(userID, obj.zTrans); if (!ret) throw new ApplicationException(DALObj.ErrorMessage); _LOID = DALObj.LOID; obj.zTrans.Commit(); obj.CloseConnection(); } else { throw new ApplicationException(DALObj.ErrorMessage); } } catch (Exception ex) { obj.zTrans.Rollback(); obj.CloseConnection(); ret = false; _error = ex.Message; } return ret; }