public void ListView(object sender) { string region = (string)(((object[])sender)[0]); string flowCode = (string)(((object[])sender)[1]); DateTime date = (DateTime)(((object[])sender)[2]); string code = (string)(((object[])sender)[3]); string itemCode = (string)(((object[])sender)[4]); IList <Shift> shiftList = (IList <Shift>)(((object[])sender)[5]); if (shiftList != null && shiftList.Count > 0) { shiftIdList = new List <string>(); foreach (Shift shift in shiftList) { shiftIdList.Add(shift.Code); } } IList <ShiftPlanSchedule> spsList = TheShiftPlanScheduleMgr.GetShiftPlanScheduleList(region, flowCode, date, code, itemCode, this.CurrentUser.Code); DataTable dt = TheShiftPlanScheduleMgr.ConvertShiftPlanScheduleToDataTable(spsList, shiftList); GV_List.DataSource = dt; GV_List.DataBind(); this.HideColumns(shiftList); }
public void Save() { Shift shift = TheShiftMgr.LoadShift(ShiftCode); decimal planQty = this.tbPlanQty.Text.Trim() != string.Empty ? decimal.Parse(this.tbPlanQty.Text) : 0; ShiftPlanSchedule sps = new ShiftPlanSchedule(); if (ShiftPlanScheduleId > 0) { //Update sps = TheShiftPlanScheduleMgr.LoadShiftPlanSchedule(ShiftPlanScheduleId); if (sps.Shift == null) { sps.Shift = shift; } sps.PlanQty = planQty; TheShiftPlanScheduleMgr.UpdateShiftPlanSchedule(sps); } else { if (planQty > 0) { //Create sps.FlowDetail = TheFlowDetailMgr.LoadFlowDetail(FlowDetailId); sps.ReqDate = ReqDate; sps.Shift = shift; sps.Sequence = 0;//todo sps.PlanQty = planQty; sps.LastModifyDate = DateTime.Now; sps.LastModifyUser = this.CurrentUser; TheShiftPlanScheduleMgr.CreateShiftPlanSchedule(sps); } } }
public void GenOrders() { if (ShiftPlanScheduleId > 0) { TheShiftPlanScheduleMgr.GenOrdersByShiftPlanScheduleId(ShiftPlanScheduleId, this.CurrentUser.Code); } }
public void Control_DataBind() { if (ShiftPlanScheduleId > 0) { ShiftPlanSchedule sps = TheShiftPlanScheduleMgr.LoadShiftPlanSchedule(ShiftPlanScheduleId); this.tbPlanQty.Text = sps.PlanQty.ToString("0.########"); } }
private void Import() { try { string region = this.tbRegion.Text.Trim() != string.Empty ? this.tbRegion.Text.Trim() : string.Empty; string flowCode = this.tbFlow.Text.Trim() != string.Empty ? this.tbFlow.Text.Trim() : string.Empty; DateTime date = DateTime.Parse(this.tbDate.Text); string shiftCode = this.ucShift.ShiftCode; decimal leadTime = decimal.Parse(this.tbLeadTime.Text.Trim()); IList <ShiftPlanSchedule> spsList = TheImportMgr.ReadPSModelFromXls(fileUpload.PostedFile.InputStream, this.CurrentUser, region, flowCode, date, shiftCode); TheShiftPlanScheduleMgr.SaveShiftPlanSchedule(spsList, this.CurrentUser); IList <OrderHead> ohList = TheOrderMgr.ConvertShiftPlanScheduleToOrders(spsList, leadTime); if (ImportEvent != null) { ImportEvent(new object[] { ohList }, null); } ShowSuccessMessage("Import.Result.Successfully"); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }