public virtual string CreateOperationList(CheckBoxList chkList, CheckBoxList chklistAttribute) { string opcontrol = ""; //foreach (System.Web.UI.WebControls.ListItem item in chkList.Items) //{ // opcontrol = string.Format("{0}{1}", opcontrol, FormatHelper.BooleanToString(item.Selected)); //} //OPControl长度为16位 for (int i = 0; i < 16; i++) { //2个选择列表都没有则默认放0 if ((!chkList.Items.Contains(chkList.Items.FindByValue(i.ToString()))) && (!chklistAttribute.Items.Contains(chklistAttribute.Items.FindByValue(i.ToString())))) { opcontrol = string.Format("{0}{1}", opcontrol, "0"); } else { //如果chkList没有该选项,则chklistAttribute肯定有,按照有的来放值 if (chkList.Items.Contains(chkList.Items.FindByValue(i.ToString()))) { opcontrol = string.Format("{0}{1}", opcontrol, FormatHelper.BooleanToString (chkList.Items.FindByValue(i.ToString()).Selected)); } else { opcontrol = string.Format("{0}{1}", opcontrol, FormatHelper.BooleanToString (chklistAttribute.Items.FindByValue(i.ToString()).Selected)); } } } return(opcontrol); }
protected void cmdUploadError_ServerClick(object sender, System.EventArgs e) { SystemSettingFacade facade = new SystemSettingFacade(base.DataProvider); SystemError systemError = facade.CreateNewSystemError(); systemError.SystemErrorCode = Guid.NewGuid().ToString(); systemError.ErrorMessage = FormatHelper.CleanString(this.GetRequestParam("msg"), 100); systemError.InnerErrorMessage = FormatHelper.CleanString(this.GetRequestParam("innermsg"), 100); systemError.TriggerModuleCode = SessionHelper.Current(this.Session).ModuleCode; systemError.SendUser = this.GetUserCode(); if (systemError.SendUser == null || systemError.SendUser == string.Empty) { systemError.SendUser = "******"; } systemError.SendDate = FormatHelper.TODateInt(DateTime.Now); systemError.SendTime = FormatHelper.TOTimeInt(DateTime.Now); systemError.IsResolved = FormatHelper.BooleanToString(false); systemError.MaintainUser = this.GetUserCode(); if (systemError.MaintainUser == null || systemError.MaintainUser == string.Empty) { systemError.MaintainUser = "******"; } facade.AddSystemError(systemError); string scriptString = "<script language=JavaScript>window.name+='[back]';window.parent.history.back(-1);</script>"; if (!this.IsClientScriptBlockRegistered("clientScript")) { this.RegisterClientScriptBlock("clientScript", scriptString); } }
/// <summary> /// Undo时更新Simulation数据 /// </summary> private void UndoNGSimulation(Simulation simulation, bool isNG, OnWIP wip) { // 更新Simulation DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider); string lastAction = wip.Action; simulation.LastAction = lastAction; string[] actionList = simulation.ActionList.Split(';'); simulation.ActionList = string.Join(";", actionList, 0, actionList.Length - 2) + ";"; simulation.ProductStatus = wip.ActionResult; if (isNG == true) { simulation.NGTimes = simulation.NGTimes - 1; } simulation.IsComplete = FormatHelper.BooleanToString(false); //simulation.RunningCardSequence = wip.RunningCardSequence; // 保留测试信息 dataCollectFacade.UpdateSimulation(simulation); // 更新SimulationReport SimulationReport simulationReport = (SimulationReport)dataCollectFacade.GetLastSimulationReport(simulation.RunningCard); simulationReport.LastAction = lastAction; simulationReport.Status = wip.ActionResult; if (isNG == true) { simulationReport.NGTimes = simulationReport.NGTimes - 1; } simulationReport.IsComplete = FormatHelper.BooleanToString(false); //simulationReport.RunningCardSequence = wip.RunningCardSequence; // 保留测试信息 dataCollectFacade.UpdateSimulationReport(simulationReport); }
protected override object GetEditObject() { //this.ValidateInput(); if (_facade == null) { _facade = new SystemSettingFacade(base.DataProvider); } BenQGuru.eMES.Domain.BaseSetting.Parameter parameter = this._facade.CreateNewParameter(); parameter.ParameterCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtParameterCodeEdit.Text, 40)); parameter.ParameterDescription = FormatHelper.CleanString(this.txtParameterDescriptionEdit.Text, 40); parameter.IsActive = FormatHelper.BooleanToString(this.chbIsActiveEdit.Checked); parameter.IsSystem = FormatHelper.BooleanToString(this.chbIsSystemEdit.Checked); parameter.ParameterGroupCode = this.drpParameterGroupCodeEdit.SelectedValue; parameter.ParameterSequence = FormatHelper.CleanString(this.txtParameterSeq.Text, 40); //参数顺序 if (this.drpParameterGroupCodeEdit.SelectedValue == "") { parameter.ParameterValue = txtParameterCodeEdit.Text.Trim(); } else { parameter.ParameterValue = this.drpParamterValueEdit.SelectedValue; } parameter.ParameterAlias = FormatHelper.CleanString(this.txtParameterAliasEdit.Text, 40); parameter.MaintainUser = this.GetUserCode(); parameter.ParentParameterCode = this.drpParentParameter.SelectedValue; return(parameter); }
private object GetEditObject() { if (_modelFacade == null) { _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade(); } Model2OP model2Operation = (Model2OP)this._modelFacade.GetModel2Operation(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID); try { model2Operation.OPSequence = System.Int32.Parse(this.txtOperationsequenceEdit.Text.Trim()); } catch { model2Operation.OPSequence = 0; } model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 9, this.chbOperationCheckEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 8, this.chbCompLoadingEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 7, this.chbIDMergeEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 6, this.chbStartOpEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 5, this.chbEndOpEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 4, this.chbPackEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 3, this.chbEditSPC.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 2, this.chbRepairEdit.Checked); model2Operation.OPControl = FormatHelper.BooleanToString(model2Operation.OPControl, model2Operation.OPControl.Length - 1, this.chbNGTestEdit.Checked); model2Operation.OrganizationID = GlobalVariables.CurrentOrganizations.First().OrganizationID; return(model2Operation); }
private object GetEditObject() { if (this.ValidateInput()) { if (_modelFacade == null) { _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade(); } Model model = this._modelFacade.CreateNewModel(); model.ModelCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtModelCodeEdit.Text, 40)); model.ModelDescription = FormatHelper.CleanString(this.txtModelDescriptionEdit.Text, 100); model.MaintainUser = this.GetUserCode(); model.IsInventory = FormatHelper.BooleanToString(this.chbIsIn.Checked); model.IsReflow = FormatHelper.BooleanToString(this.chbIsReflow.Checked); model.IsCheckDataLink = FormatHelper.BooleanToString(this.chbIsDataLink.Checked); model.DataLinkQty = (this.chbIsDataLink.Checked?int.Parse(this.txtDataLinkQty.Text):0); model.IsDim = FormatHelper.BooleanToString(this.chbIsDim.Checked); model.DimQty = (this.chbIsDim.Checked?int.Parse(this.txtDimQty.Text):0); model.OrganizationID = int.Parse(this.DropDownListOrg.SelectedValue); return(model); } else { return(null); } }
protected void cmdResolve_ServerClick(object sender, System.EventArgs e) { ArrayList array = this.gridHelper.GetCheckedRows(); if (array.Count > 0) { ArrayList systemErrors = new ArrayList(array.Count); foreach (UltraGridRow row in array) { object obj = this.GetEditObject(row); if (obj != null) { ((SystemError)obj).IsResolved = FormatHelper.BooleanToString(true); ((SystemError)obj).ResolveDate = FormatHelper.TODateInt(DateTime.Now); ((SystemError)obj).ResolveTime = FormatHelper.TOTimeInt(DateTime.Now); ((SystemError)obj).ResolveUser = this.GetUserCode(); systemErrors.Add(obj); } } if (_facade == null) { _facade = new SystemSettingFacadeFactory(base.DataProvider).Create(); } this._facade.UpdateSystemError((SystemError[])systemErrors.ToArray(typeof(SystemError))); this.gridHelper.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Save); } }
public static void UploadError(string msg, string innserMsg) { SQLDomainDataProvider provider = BenQGuru.eMES.Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider() as SQLDomainDataProvider; SystemSettingFacade facade = new SystemSettingFacade(provider); SystemError systemError = facade.CreateNewSystemError(); systemError.SystemErrorCode = Guid.NewGuid().ToString(); systemError.ErrorMessage = FormatHelper.CleanString(msg, 100); systemError.InnerErrorMessage = FormatHelper.CleanString(innserMsg, 100); systemError.TriggerModuleCode = SessionHelper.Current(HttpContext.Current.Session).ModuleCode; systemError.SendUser = SessionHelper.Current(HttpContext.Current.Session).UserCode; if (systemError.SendUser == null || systemError.SendUser == string.Empty) { systemError.SendUser = "******"; } systemError.SendDate = FormatHelper.TODateInt(DateTime.Now); systemError.SendTime = FormatHelper.TOTimeInt(DateTime.Now); systemError.IsResolved = FormatHelper.BooleanToString(false); systemError.MaintainUser = SessionHelper.Current(HttpContext.Current.Session).UserCode; if (systemError.MaintainUser == null || systemError.MaintainUser == string.Empty) { systemError.MaintainUser = "******"; } facade.AddSystemError(systemError); provider.PersistBroker.CloseConnection(); }
private string GetOPControl() { string opcontrol = ""; foreach (System.Web.UI.WebControls.ListItem item in this.chklstOPControlEdit.Items) { opcontrol = string.Format("{0}{1}", opcontrol, FormatHelper.BooleanToString(item.Selected)); } return(opcontrol); }
protected override object GetEditObject() { if (_facade == null) { _facade = new BaseModelFacadeFactory(base.DataProvider).Create(); } Route route = this._facade.CreateNewRoute(); route.RouteDescription = FormatHelper.CleanString(this.txtRouteDescriptionEdit.Text, 100); route.RouteType = this.drpRouteTypeEdit.SelectedValue; route.EffectiveDate = 0; //FormatHelper.TODateInt(this.dateEffectiveDateEdit.Text); route.InvalidDate = 0; //FormatHelper.TODateInt(this.dateInvalidDateEdit.Text); route.RouteCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRouteCodeEdit.Text, 40)); route.MaintainUser = this.GetUserCode(); route.Enabled = FormatHelper.BooleanToString(this.chbRouteEnabled.Checked); return(route); }
protected override object GetEditObject() { //this.ValidateInput(); if (_facade == null) { _facade = new SystemSettingFacade(base.DataProvider); } ParameterGroup parameterGroup = this._facade.CreateNewParameterGroup(); parameterGroup.ParameterGroupType = FormatHelper.CleanString(this.txtParameterGroupTypeEdit.Text, 40); parameterGroup.ParameterGroupDescription = FormatHelper.CleanString(this.txtParameterGroupDescriptionEdit.Text, 100); parameterGroup.IsSystem = FormatHelper.BooleanToString(this.chbIsSystemGroupEdit.Checked); parameterGroup.ParameterGroupCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtParameterGroupCodeEdit.Text, 40)); parameterGroup.MaintainUser = this.GetUserCode(); return(parameterGroup); }
protected override object GetEditObject() { if (_facade == null) { _facade = new WarehouseFacade(base.DataProvider); } Warehouse warehouse = this._facade.CreateNewWarehouse(); warehouse.FactoryCode = this.drpFactoryCodeEdit.SelectedValue; //warehouse.SegmentCode = this.drpSegmentCodeEdit.SelectedValue; warehouse.WarehouseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtWarehouseCodeEdit.Text, 50)); warehouse.WarehouseDescription = FormatHelper.CleanString(this.txtWarehouseDescEdit.Text, 100); warehouse.WarehouseType = this.drpWarehouseTypeEdit.SelectedValue; warehouse.WarehouseStatus = this.drpWarehouseStatusEdit.SelectedValue; warehouse.IsControl = FormatHelper.BooleanToString(this.chbIsControl.Checked); warehouse.MaintainUser = this.GetUserCode(); return(warehouse); }
protected override object GetEditObject() { if (_facade == null) { _facade = new ShiftModelFacadeFactory(base.DataProvider).Create(); } Shift shift = this._facade.CreateNewShift(); shift.ShiftDescription = FormatHelper.CleanString(this.txtShiftDescriptionEdit.Text, 100); shift.ShiftBeginTime = FormatHelper.TOTimeInt(this.timeShiftBeginTimeEdit.Text); shift.ShiftEndTime = FormatHelper.TOTimeInt(this.timeShiftEndTimeEdit.Text); shift.IsOverDate = FormatHelper.BooleanToString(this.chbIsOverDateEdit.Checked); shift.ShiftSequence = System.Decimal.Parse(this.txtShiftSequenceEdit.Text); shift.ShiftCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtShiftCodeEdit.Text, 40)); shift.ShiftTypeCode = this.drpShiftTypeCodeEdit.SelectedValue; shift.MaintainUser = this.GetUserCode(); return(shift); }
private object GetEditObject() { if (this.ValidateInput()) { if (_itemFacade == null) { _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade(); } Item item = this._itemFacade.CreateNewItem(); item.ItemCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemCodeEdit.Text, 40)); item.ItemDescription = FormatHelper.CleanString(this.txtItemDescEdit.Text, 100); item.ItemType = FormatHelper.CleanString(this.drpItemTypeEdit.SelectedValue, 40); item.ItemName = FormatHelper.CleanString(this.txtItemNameEdit.Text, 100); item.ItemUOM = FormatHelper.CleanString(this.txtItemUOMEdit.Text, 40); item.ItemDate = FormatHelper.TODateInt(DateTime.Today.ToShortDateString()); item.ItemUser = FormatHelper.CleanString(this.GetUserCode()); item.ItemConfigration = FormatHelper.CleanString(this.txtConfig.Text, 40); //item.ItemBurnInQty = Convert.ToInt32( FormatHelper.CleanString(this.txtVolumnEdit.Text, 10) ) ; item.ItemCartonQty = Convert.ToInt32(FormatHelper.CleanString(this.txtCartonQty.Text, 10)); item.MaintainUser = this.GetUserCode(); item.ElectricCurrentMaxValue = Convert.ToDecimal(FormatHelper.CleanString(this.txtMaxElectricCurrent.Text, 18)); item.ElectricCurrentMinValue = Convert.ToDecimal(FormatHelper.CleanString(this.txtMinElectricCurrent.Text, 18)); item.CheckItemOP = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtOPCodeEdit.Text, 40)); item.LotSize = Convert.ToInt32(this.txtLotSizeEdit.Text.Trim()); item.ItemProductCode = FormatHelper.CleanString(this.TextboxItemProductCodeEdit.Text, 100); item.NeedCheckCarton = FormatHelper.BooleanToString(this.CheckboxNeedCheckCartonEdit.Checked); item.NeedCheckAccessory = FormatHelper.BooleanToString(this.CheckboxNeedCheckComApp.Checked); item.OrganizationID = int.Parse(this.DropDownListOrg.SelectedValue); item.PcbaCount = Convert.ToInt32(this.txtPcbAcountEdit.Text.Trim()); item.BurnUseMinutes = Convert.ToInt32(this.txtBurnUseMinutesEdit.Text.Trim()); //Add by sandy on 20140530 return(item); } else { return(null); } }
protected override object GetEditObject() { if(_facade==null) { _facade = new ShiftModelFacadeFactory(base.DataProvider).Create() ; } TimePeriod timePeriod = this._facade.CreateNewTimePeriod(); timePeriod.TimePeriodBeginTime = FormatHelper.TOTimeInt(this.timeTimePeriodBeginTimeEdit.Text); timePeriod.TimePeriodEndTime = FormatHelper.TOTimeInt(this.timeTimePeriodEndTimeEdit.Text); timePeriod.IsOverDate = FormatHelper.BooleanToString(this.chbIsOverDateEdit.Checked); timePeriod.TimePeriodCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtTimePeriodCodeEdit.Text, 40)); timePeriod.TimePeriodDescription = FormatHelper.CleanString(this.txtTimePeriodDescriptionEdit.Text, 100); timePeriod.TimePeriodType = this.drpTimePeriodTypeEdit.SelectedValue; timePeriod.ShiftCode = this.drpShiftCodeEdit.SelectedValue; timePeriod.ShiftTypeCode = FormatHelper.CleanString(this.txtShiftTypeCodeEdit.Text, 40); timePeriod.TimePeriodSequence = System.Int32.Parse( this.txtTimePeriodSequenceEdit.Text ); timePeriod.MaintainUser = this.GetUserCode(); return timePeriod; }
protected override object GetEditObject() { if (_facade == null) { _facade = new WarehouseFacade(base.DataProvider); } TransactionType tt = this._facade.CreateNewTransactionType(); tt.TransactionTypeCode = FormatHelper.CleanString(this.txtTransTypeCodeEdit.Text, 50); tt.TransactionTypeName = FormatHelper.CleanString(this.txtTransTypeNameEdit.Text, 100); tt.TransactionTypeDescription = FormatHelper.CleanString(this.txtTransTypeDescriptionEdit.Text, 100); //tt.IsByMOControl = FormatHelper.BooleanToString(this.chbIsByMOControl.Checked); tt.IsByMOControl = FormatHelper.BooleanToString(this.JudgeByMO(tt.TransactionTypeCode, this.chbIsByMOControl.Checked)); tt.TransactionPrefix = FormatHelper.PKCapitalFormat(this.txtTransTypeCategoryEdit.Text.Trim()); tt.MaintainUser = this.GetUserCode(); if (tt.TransactionPrefix == string.Empty) { tt.TransactionPrefix = FormatHelper.PKCapitalFormat(GetTransTypePrefix(tt.TransactionTypeCode)); } return(tt); }
protected override object GetEditObject() { if (this._facade == null) { this._facade = new ReportViewFacade(this.DataProvider); } RptViewEntry entry = this._facade.CreateNewRptViewEntry(); if (this.txtRptEntryCode.ReadOnly == true) { entry = (RptViewEntry)this._facade.GetRptViewEntry(this.txtRptEntryCode.Text); } entry.Sequence = decimal.Parse(this.txtRptEntrySequence.Text); entry.EntryCode = this.txtRptEntryCode.Text.Trim().ToUpper(); entry.EntryName = this.txtRptEntryName.Text.Trim().ToUpper(); entry.Description = this.txtRptEntryDesc.Text; entry.Visible = FormatHelper.BooleanToString(this.chkRptIsVisible.Checked); entry.MaintainUser = this.GetUserCode(); return(entry); }
protected override object GetEditObject() { if (_facade == null) { _facade = new TSModelFacadeFactory(base.DataProvider).CreateTSModelFacade(); } TSSmartConfig smartCfg = this._facade.CreateNewTSSmartConfig(); if (this.txtSequence.Text != "") { smartCfg.Sequence = decimal.Parse(this.txtSequence.Text); } smartCfg.ErrorCode = FormatHelper.CleanString(FormatHelper.PKCapitalFormat(this.txtErrorCodeEdit.Text), 40); smartCfg.Enabled = FormatHelper.BooleanToString(this.chkEnabledSmart.Checked); smartCfg.SortBy = this.drpSortBy.SelectedValue; smartCfg.DateRange = decimal.Parse(this.txtSmartDateRange.Text); smartCfg.DateRangeType = this.drpSmartDateRangeType.SelectedValue; smartCfg.ShowItemCount = decimal.Parse(this.txtShowItemCount.Text); smartCfg.MaintainUser = this.GetUserCode(); return(smartCfg); }
protected void cmdSave_ServerClick(object sender, System.EventArgs e) { if (_itemFacade == null) { _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade(); } if (EditGrid == "gridWebGrid") { //add by roger.xue int iDefaultRouteCount = 0; foreach (GridRecord row in this.gridWebGrid.Rows) { if (row.Items.FindItemByKey("DefaultItemRoute").Value.ToString().ToLower() == "true") { iDefaultRouteCount++; } } if (iDefaultRouteCount > 1) { //throw new Exception("$Error_Default_Route_More_than_one"); WebInfoPublish.PublishInfo(this.Page, "$Error_Default_Route_More_than_one", this.languageComponent1); return; } if (iDefaultRouteCount < 1) { WebInfoPublish.PublishInfo(this.Page, "$Error_Default_Route_Must_one", this.languageComponent1); return; } for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { if (this.gridWebGrid.Rows[i].Items.FindItemByKey(this.gridHelper.CheckColumnKey).Value.ToString().ToLower() == "false") { if (this.gridWebGrid.Rows[i].Items.FindItemByKey("DefaultItemRoute").Value.ToString().ToLower() == "true") { WebInfoPublish.PublishInfo(this.Page, "$Error_Only_Chose_This_Product_route", this.languageComponent1); return; //throw new Exception("$Error_Only_Chose_This_Product_route"); } } } //end add foreach (GridRecord row in this.gridWebGrid.Rows) { if (row.Items.FindItemByKey(this.gridHelper.CheckColumnKey).Value.ToString().ToLower() == "true") { //选择则到数据可查找如果不存在添加, this._itemFacade.AddItemRoutes(ItemCode, new Item2Route[] { (Item2Route)this.GetEditObject(row) }); //add by roger.xue 添加默认途程 AddDefaultRoute(row); //end add } else { object item2Route = this._itemFacade.GetItem2Route(ItemCode, row.Items.FindItemByKey("RouteCode").Value.ToString(), GlobalVariables.CurrentOrganizations.First().OrganizationID.ToString()); if (item2Route != null) { if (this._itemFacade.IsItemRouteComponentLoading((Item2Route)item2Route)) { row.Items.FindItemByKey("IsReference").Text = FormatHelper.BooleanToString(true); arrayDeleteRoutes.Add(item2Route); } else { row.Items.FindItemByKey("IsReference").Text = FormatHelper.BooleanToString(false); //this._itemFacade.DeleteItem2Route((Item2Route)item2Route); this._itemFacade.DeleteItem2RouteWithOPBOM((Item2Route)item2Route); //add by roger.xue DeleteDefaultRoute((Item2Route)item2Route); //end add } } } } if (arrayDeleteRoutes.Count == 0) { EditGrid = "gridWebGrid1"; RegistScript(); } else { EditGrid = "gridWebGrid1"; } } else { foreach (GridRecord row in this.gridWebGrid.Rows) { if (row.Items.FindItemByKey(this.gridHelper.CheckColumnKey).Value.ToString().ToLower() == "true") { object item2Route = this._itemFacade.GetItem2Route(ItemCode, row.Items.FindItemByKey("RouteCode").Value.ToString(), GlobalVariables.CurrentOrganizations.First().OrganizationID.ToString()); if (item2Route != null) { this._itemFacade.DeleteItem2RouteWithOPBOM((Item2Route)item2Route); //add by roger.xue DeleteDefaultRoute((Item2Route)item2Route); //end add } } } EditGrid = "gridWebGrid"; lblItemRouteMaintain.Visible = true; lblItemRouteMaintain.Text = this.languageComponent1.GetString("$Error_ItemRouteInformation"); RegistScript(); } // this._itemFacade.AddItemRoutes(ItemCode, (Item2Route[])routes.ToArray( typeof(Item2Route) ) ); this.gridHelper.GridBind(PageGridBunding.Page, int.MaxValue); }
protected override void AddDomainObject(object domainObject) { if (_facade == null) { _facade = new SMTFacadeFactory(base.DataProvider).Create(); } DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); try { //判断数据的合法性 ArrayList list = CheckItem(domainObject); if (list.Count == 0) { WebInfoPublish.Publish(this, "$Error_DataMaterial_Right", this.languageComponent1); return; } SMTFeederMaterial item = list[0] as SMTFeederMaterial; if (item.EAttribute1 != "True") { WebInfoPublish.Publish(this, item.EAttribute1, this.languageComponent1); return; } this.DataProvider.BeginTransaction(); //根据产品代码+产线代码得到TBLSMTFEEDERMATERIALIMPLOG最大logno object obj = _facade.GetSMTFeederMaterialOfMaxLogNo((domainObject as SMTFeederMaterial).ProductCode, (domainObject as SMTFeederMaterial).StepSequenceCode); if (obj == null || (obj as SMTFeederMaterialImportLog).LOGNO < 1) { _facade.UpdateMachineFeeder(item.ProductCode, item.StepSequenceCode); _facade.AddSMTFeederMaterial(item); decimal logNo = 1; object objMaxLotNo = _facade.GetMaxLotNoSmtFeedermateriaLog(); if (objMaxLotNo != null) { logNo = (objMaxLotNo as SMTFeederMaterialImportLog).LOGNO + 1; } //_facade.ImportSMTFeederMaterial(new object[] { domainObject }, this.GetUserCode()); // 加入Log SMTFeederMaterialImportLog log = new SMTFeederMaterialImportLog(); log.LOGNO = logNo; log.Sequence = 1; log.ImportUser = this.GetUserCode(); log.ImportDate = dbDateTime.DBDate; log.ImportTime = dbDateTime.DBTime; log.CheckResult = FormatHelper.BooleanToString(true); if (Convert.ToBoolean(item.EAttribute1.Split(':')[0]) == false) { log.CheckResult = FormatHelper.BooleanToString(false); log.CheckDescription = item.EAttribute1.Split(':')[1]; } log.MachineCode = item.MachineCode; log.MachineStationCode = item.MachineStationCode; log.ProductCode = item.ProductCode; log.StepSequenceCode = item.StepSequenceCode; log.MaterialCode = item.MaterialCode; log.SourceMaterialCode = item.SourceMaterialCode; log.FeederSpecCode = item.FeederSpecCode; log.Qty = item.Qty; log.TableGroup = item.TableGroup; log.MaintainUser = item.MaintainUser; log.MaintainDate = item.MaintainDate; log.MaintainTime = item.MaintainTime; _facade.AddSMTFeederMaterialImportLog(log); } else { object[] objs = _facade.QuerySMTFeederMaterialImportLog((obj as SMTFeederMaterialImportLog).LOGNO, item.ProductCode, item.StepSequenceCode, item.MachineCode, item.MachineStationCode); if (objs != null && objs.Length > 0) { this.DataProvider.RollbackTransaction(); WebInfoPublish.Publish(this, "$Message_FeederMaterialData_Exist", this.languageComponent1); return; } else { _facade.UpdateMachineFeeder(item.ProductCode, item.StepSequenceCode); _facade.AddSMTFeederMaterial(item); //_facade.ImportSMTFeederMaterial(new object[] { domainObject }, this.GetUserCode()); // 加入Log decimal sequence = 1; object objMaxSeq = _facade.GetMaxSeqSmtFeederMaterialLog((obj as SMTFeederMaterialImportLog).LOGNO); if (objMaxSeq != null) { sequence = (objMaxSeq as SMTFeederMaterialImportLog).Sequence + 1; } SMTFeederMaterialImportLog log = new SMTFeederMaterialImportLog(); log.LOGNO = (obj as SMTFeederMaterialImportLog).LOGNO; log.Sequence = sequence; log.ImportUser = this.GetUserCode(); log.ImportDate = dbDateTime.DBDate; log.ImportTime = dbDateTime.DBTime; log.CheckResult = FormatHelper.BooleanToString(true); if (Convert.ToBoolean(item.EAttribute1.Split(':')[0]) == false) { log.CheckResult = FormatHelper.BooleanToString(false); log.CheckDescription = item.EAttribute1.Split(':')[1]; } log.MachineCode = item.MachineCode; log.MachineStationCode = item.MachineStationCode; log.ProductCode = item.ProductCode; log.StepSequenceCode = item.StepSequenceCode; log.MaterialCode = item.MaterialCode; log.SourceMaterialCode = item.SourceMaterialCode; log.FeederSpecCode = item.FeederSpecCode; log.Qty = item.Qty; log.TableGroup = item.TableGroup; log.MaintainUser = item.MaintainUser; log.MaintainDate = item.MaintainDate; log.MaintainTime = item.MaintainTime; _facade.AddSMTFeederMaterialImportLog(log); } } this.DataProvider.CommitTransaction(); } catch (Exception ex) { this.DataProvider.RollbackTransaction(); WebInfoPublish.Publish(this, "$Error_Add_FeederMaterial", this.languageComponent1); } }
protected override void UpdateReportDesignView() { ArrayList listFilterUI = new ArrayList(); Dictionary <string, string> filterUIList = new Dictionary <string, string>(); string strFilterUI = this.hidInputUIType.Value; string[] strFilterUIList = strFilterUI.Split('|'); for (int i = 0; i < strFilterUIList.Length; i++) { if (strFilterUIList[i] != "") { string[] strTmpList = strFilterUIList[i].Split('@'); filterUIList.Add(strTmpList[0], strTmpList[1]); } } RptViewFileParameter[] parames = new RptViewFileParameter[this.gridWebGrid.Rows.Count]; for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { RptViewFileParameter param = new RptViewFileParameter(); param.Sequence = i + 1; param.FileParameterName = this.gridWebGrid.Rows[i].Items.FindItemByKey("ParameterName").Text; param.Description = this.gridWebGrid.Rows[i].Items.FindItemByKey("ParameterDesc").Text; param.DataType = this.gridWebGrid.Rows[i].Items.FindItemByKey("DataType").Text; param.DefaultValue = this.gridWebGrid.Rows[i].Items.FindItemByKey("DefaultValue").Text; param.ViewerInput = FormatHelper.BooleanToString(Convert.ToBoolean(this.gridWebGrid.Rows[i].Items.FindItemByKey("UserInput").Value)); parames[i] = param; string strName = param.FileParameterName; if (filterUIList.ContainsKey(strName) == true) { RptViewFilterUI filterUI = new RptViewFilterUI(); filterUI.Sequence = listFilterUI.Count + 1; filterUI.InputType = ReportViewerInputType.FileParameter; filterUI.InputName = strName; filterUI.SqlFilterSequence = 0; string[] strUIValList = filterUIList[strName].Split(';'); filterUI.UIType = strUIValList[0]; if (filterUI.UIType == ReportFilterUIType.SelectQuery) { filterUI.SelectQueryType = strUIValList[1]; } else if (filterUI.UIType == ReportFilterUIType.DropDownList) { filterUI.ListDataSourceType = strUIValList[1]; if (filterUI.ListDataSourceType == "static") { string strStaticVal = ""; for (int n = 2; n < strUIValList.Length; n++) { if (strUIValList[n] != "" && strUIValList[n].IndexOf(",") >= 0) { strStaticVal += strUIValList[n] + ";"; } } filterUI.ListStaticValue = strStaticVal; } else { filterUI.ListDynamicDataSource = decimal.Parse(strUIValList[2]); filterUI.ListDynamicTextColumn = strUIValList[3]; filterUI.ListDynamicValueColumn = strUIValList[4]; } } listFilterUI.Add(filterUI); } } this.designView.FileParameters = parames; for (int i = 0; this.designView.FiltersUI != null && i < this.designView.FiltersUI.Length; i++) { if (this.designView.FiltersUI[i].InputType != ReportViewerInputType.FileParameter) { listFilterUI.Add(this.designView.FiltersUI[i]); } } RptViewFilterUI[] targetFilterUI = new RptViewFilterUI[listFilterUI.Count]; listFilterUI.CopyTo(targetFilterUI); this.designView.FiltersUI = targetFilterUI; }
// 查看报表 private void cmdQuery_ServerClick(object sender, EventArgs e) { ArrayList listInput = new ArrayList(); string strMess = string.Empty; // 遍历每个输入项 for (int i = 0; i < this.tbInput.Rows.Count; i++) { for (int n = 0; n < this.tbInput.Rows[i].Cells.Count; n++) { for (int x = 0; x < this.tbInput.Rows[i].Cells[n].Controls.Count; x++) { Control ctl = this.tbInput.Rows[i].Cells[n].Controls[x]; string strType = "", strName = "", strValue = ""; decimal dSqlSeq = 0; bool bIsInputControl = false; if (ctl is WebControl || ctl is System.Web.UI.UserControl) { if (ctl is WebControl && ((WebControl)ctl).Attributes["IsReportViewerInput"] == "1") { bIsInputControl = true; WebControl wcontrol = (WebControl)ctl; strType = wcontrol.Attributes["InputType"]; strName = wcontrol.Attributes["InputName"]; dSqlSeq = decimal.Parse(wcontrol.Attributes["SqlFilterSequence"]); } else if (ctl is System.Web.UI.UserControl && ((System.Web.UI.UserControl)ctl).Attributes["IsReportViewerInput"] == "1") { bIsInputControl = true; System.Web.UI.UserControl wcontrol = (System.Web.UI.UserControl)ctl; strType = wcontrol.Attributes["InputType"]; strName = wcontrol.Attributes["InputName"]; dSqlSeq = decimal.Parse(wcontrol.Attributes["SqlFilterSequence"]); } } if (bIsInputControl == true) { if (ctl is TextBox) { strValue = ((TextBox)ctl).Text.Trim().ToUpper(); } else if (ctl is CheckBox) { strValue = FormatHelper.BooleanToString(((CheckBox)ctl).Checked); } else if (ctl is DropDownList) { strValue = ((DropDownList)ctl).SelectedValue; } else if (ctl is UserControl.eMESDate) { strValue = FormatHelper.TODateInt(((UserControl.eMESDate)ctl).Text).ToString(); } else if (ctl is BenQGuru.eMES.Web.SelectQuery.SelectableTextBox) { strValue = ((BenQGuru.eMES.Web.SelectQuery.SelectableTextBox)ctl).Text; } RptViewUserSubscription subs = new RptViewUserSubscription(); subs.InputType = strType; subs.InputName = strName; //Add 2008/11/04 if (string.IsNullOrEmpty(strValue) || (ctl is UserControl.eMESDate && strValue == "0")) { if (rptFacade == null) { rptFacade = new ReportViewFacade(this.DataProvider); } RptViewFilterUI[] objUIs = rptFacade.GetRptViewFilterUIByReportIdAndSeq(this.ReportID, strName, dSqlSeq); if (objUIs != null && objUIs.Length > 0) { foreach (RptViewFilterUI objUI in objUIs) { if (objUI.CheckExist == "Y") { //添加异常 //throw new Exception( strName + "$ReportDesign_NOT_AllowNull"); //string alertInfo = // string.Format("<script language=javascript>alert('{0}');</script>",strName + " " +this.languageComponent1.GetString("$ReportDesign_NOT_AllowNull")); //if (!this.ClientScript.IsClientScriptBlockRegistered("Message")) //{ // this.ClientScript.RegisterClientScriptBlock(typeof(string), "Message", alertInfo); //} //return; if (string.IsNullOrEmpty(strMess)) { if (rptFacade == null) { rptFacade = new ReportViewFacade(this.DataProvider); } RptViewGridFilter objFilter = rptFacade.GetRptViewGridFiltersByReportIdAndName(this.ReportID, strName, dSqlSeq); if (objFilter != null) { strMess = objFilter.Description; } else { strMess = strName; } } else { if (rptFacade == null) { rptFacade = new ReportViewFacade(this.DataProvider); } RptViewGridFilter objFilter = rptFacade.GetRptViewGridFiltersByReportIdAndName(this.ReportID, strName, dSqlSeq); if (objFilter != null) { strMess = strMess + "," + objFilter.Description; } else { strMess = strMess + "," + strName; } } } } } } //Add End subs.InputValue = strValue; subs.SqlFilterSequence = dSqlSeq; listInput.Add(subs); } /* * if (ctl is TextBox) * { * if (((TextBox)ctl).Attributes["IsReportViewerInput"] == "1") * { * TextBox txt = (TextBox)ctl; * string strType = txt.Attributes["InputType"]; * string strName = txt.Attributes["InputName"]; * string strValue = txt.Text.Trim().ToUpper(); * decimal dSqlSeq = decimal.Parse(txt.Attributes["SqlFilterSequence"]); * RptViewUserSubscription subs = new RptViewUserSubscription(); * subs.InputType = strType; * subs.InputName = strName; * subs.InputValue = strValue; * subs.SqlFilterSequence = dSqlSeq; * listInput.Add(subs); * } * } */ } } } //查询所有的输入项,一次性报错 if (strMess != null && strMess.Length > 0) { string alertInfo = string.Format("<script language=javascript>alert('{0}');</script>", strMess + " " + this.languageComponent1.GetString("$ReportDesign_NOT_AllowNull")); //if (!this.ClientScript.IsClientScriptBlockRegistered("Message")) //{ // this.ClientScript.RegisterClientScriptBlock(typeof(string), "Message", alertInfo); ScriptManager.RegisterClientScriptBlock(this, GetType(), "Message", alertInfo, false); //} return; } // 执行查询 RptViewUserSubscription[] viewerInput = new RptViewUserSubscription[listInput.Count]; listInput.CopyTo(viewerInput); if (rptFacade == null) { rptFacade = new ReportViewFacade(this.DataProvider); } DataSet dsSource = rptFacade.ExecuteDataSetFromSource(this.ReportID, viewerInput, Server.MapPath("").ToString().Substring(0, Server.MapPath("").ToString().LastIndexOf("\\"))); this.txtDataCount.Text = dsSource.Tables[0].Rows.Count.ToString(); // 绑定报表 DisplayReportHelper rptHelper = new DisplayReportHelper(); rptHelper.BindReportViewer(rptFacade, designMain, this.ReportViewer1, dsSource, viewerInput); this.ReportViewer1.DataBind(); string[] values = new string[viewerInput.Length]; for (int i = 0; i < viewerInput.Length; i++) { values[i] = ((RptViewUserSubscription)viewerInput[i]).InputValue; } //导出报表数据 BenQGuru.eMES.DataExp.BaseEngine.ExpData(designMain.ReportName, dsSource.Tables[0], values); }
protected override void UpdateReportDesignView() { RptViewChartMain chartMain = null; if (this.designView.ChartMains != null && this.designView.ChartMains.Length > 0) { chartMain = this.designView.ChartMains[0]; } else { chartMain = new RptViewChartMain(); } chartMain.ChartSequence = 1; chartMain.DataSourceID = this.designView.DesignMain.DataSourceID; chartMain.ChartType = this.hidChartType.Value; chartMain.ChartSubType = this.hidChartSubType.Value; chartMain.ShowLegend = FormatHelper.BooleanToString(this.chkIsShowLegend.Checked); chartMain.ShowMarker = FormatHelper.BooleanToString(this.chkIsShowMarker.Checked); if (this.chkIsShowMarker.Checked == false) { chartMain.MarkerType = ""; } else { chartMain.MarkerType = this.rdoListMarkerType.SelectedValue; } chartMain.ShowLabel = FormatHelper.BooleanToString(this.chkIsShowLabel.Checked); if (this.chkIsShowLabel.Checked == false) { chartMain.LabelFormatID = ""; this.designView.ChartDataFormats = null; } else { RptViewDataFormat dataFormat = null; this.BuildDataFormat(out dataFormat, this.hidLabelFormat.Value); chartMain.LabelFormatID = dataFormat.FormatID; this.designView.ChartDataFormats = new RptViewDataFormat[] { dataFormat }; } this.designView.ChartMains = new RptViewChartMain[] { chartMain }; ArrayList list = new ArrayList(); string[] strArrTmp = this.hidSelectedSeriesValue.Value.Split(';'); for (int i = 0; i < strArrTmp.Length; i++) { if (strArrTmp[i] == "") { continue; } RptViewChartSeries series = new RptViewChartSeries(); series.ChartSequence = 1; series.SeriesSequence = i + 1; series.DataSourceID = this.designView.DesignMain.DataSourceID; series.ColumnName = strArrTmp[i]; series.Description = this.lstSelectedSeries.Items.FindByValue(series.ColumnName).Text; list.Add(series); } this.designView.ChartSeries = new RptViewChartSeries[list.Count]; list.CopyTo(this.designView.ChartSeries); list = new ArrayList(); strArrTmp = this.hidSelectedCategoryValue.Value.Split(';'); for (int i = 0; i < strArrTmp.Length; i++) { if (strArrTmp[i] == "") { continue; } RptViewChartCategory cate = new RptViewChartCategory(); cate.ChartSequence = 1; cate.CategorySequence = i + 1; cate.DataSourceID = this.designView.DesignMain.DataSourceID; cate.ColumnName = strArrTmp[i]; list.Add(cate); } this.designView.ChartCategories = new RptViewChartCategory[list.Count]; list.CopyTo(this.designView.ChartCategories); list = new ArrayList(); for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { RptViewChartData data = new RptViewChartData(); data.ChartSequence = 1; data.DataSequence = i + 1; data.DataSourceID = this.designView.DesignMain.DataSourceID; data.ColumnName = this.gridWebGrid.Rows[i].Items.FindItemByKey("ColumnName").Value.ToString(); data.Description = this.gridWebGrid.Rows[i].Items.FindItemByKey("DisplayDesc").Value.ToString(); data.TotalType = this.gridWebGrid.Rows[i].Items.FindItemByKey("TotalType").Value.ToString(); list.Add(data); } this.designView.ChartDatas = new RptViewChartData[list.Count]; list.CopyTo(this.designView.ChartDatas); }
public object[] GetSPCDeterRuleEnabled() { string strSql = "select * from TBLSPCDETERRULE where Enabled='" + FormatHelper.BooleanToString(true) + "' order by rulecode"; return(this.DataProvider.CustomQuery(typeof(SPCDeterRule), new SQLCondition(strSql))); }
private object GetEditObject() { if (this.ValidateInput()) { if (_moFacade == null) { _moFacade = new MOFacade(this.DataProvider); } Resource2MO res2mo = this._moFacade.CreateNewResource2MO(); if (this.txtSequenceEdit.Text != "") { try { res2mo.Sequence = decimal.Parse(this.txtSequenceEdit.Text); } catch {} } res2mo.ResourceCode = this.txtResourceCodeEdit.Text.ToUpper().Trim(); res2mo.StartDate = FormatHelper.TODateInt(this.dateStartDateEdit.Text); if (res2mo.StartDate > 0) { res2mo.StartTime = FormatHelper.TOTimeInt(this.dateStartTimeEdit.Text); } res2mo.EndDate = FormatHelper.TODateInt(this.dateEndDateEdit.Text); if (res2mo.EndDate > 0) { res2mo.EndTime = FormatHelper.TOTimeInt(this.dateEndTimeEdit.Text); if (res2mo.EndTime == 0) { res2mo.EndTime = 235959; } } res2mo.MOGetType = this.drpMOGetTypeEdit.SelectedValue; if (res2mo.MOGetType == Resource2MOGetType.Static) { res2mo.StaticMOCode = this.txtMOCodeEdit.Text.ToUpper().Trim(); } else if (res2mo.MOGetType == Resource2MOGetType.GetFromRCard) { res2mo.MOCodeRunningCardStartIndex = decimal.Parse(this.txtMORCardStartIndexEdit.Text); res2mo.MOCodeLength = decimal.Parse(this.txtMOLendthEdit.Text); res2mo.MOCodePrefix = this.txtMOCodePrefix.Text.ToUpper().Trim(); res2mo.MOCodePostfix = this.txtMOCodePostfix.Text.ToUpper().Trim(); } res2mo.CheckRunningCardFormat = FormatHelper.BooleanToString(this.chkCheckRCardFormatEdit.Checked); if (this.chkCheckRCardFormatEdit.Checked == true) { res2mo.RunningCardPrefix = this.txtRCardPrefixEdit.Text.ToUpper().Trim(); if (this.txtRCardLengthEdit.Text != "") { try { res2mo.RunningCardLength = decimal.Parse(this.txtRCardLengthEdit.Text); } catch {} } } res2mo.MaintainUser = this.GetUserCode(); return(res2mo); } else { return(null); } }
private object GetEditObject() { if (_facade == null) { _facade = new MOFacade(base.DataProvider); } if (ValidateInput()) { MO mo = (MO)this._facade.GetMO(GetMOCode()); mo.Factory = FormatHelper.CleanString(this.txtFactoryEdit.Text, 40); // this.drpMOTypeEdit.SelectedIndex =0; // this.drpMOStatusEdit.SelectedIndex =0; // this.txtCustomerCodeEdit.Text = string.Empty; // this.txtCustomerOrderNOEdit.Text = string.Empty; // this.txtMemo.Text = string.Empty; // this.drpRouteEdit.SelectedIndex =0; // this.chbLimitItemQtyEdit.Checked = false; // this.txtMOQtyEdit.Text = string.Empty; // this.txtInputQtyEdit.Text = string.Empty; // this.txtCompleteQtyEdit.Text = string.Empty; // this.txtUnCompleteQtyEdit.Text = string.Empty; // this.txtPlanStartDateEdit.Text = string.Empty; // this.txtPlanEndDateEdit.Text = string.Empty; // this.txtActualStartDateEdit.Text = string.Empty; // this.txtActualEndDateEdit.Text = string.Empty; // this.txtMOUserEdit.Text = string.Empty; // this.txtMODownloadDateEdit.Text = string.Empty; // this.txtScrapeQtyEdit.Text = string.Empty; mo.MOType = FormatHelper.CleanString(this.drpMOTypeEdit.SelectedValue, 40); mo.MOPlanStartDate = FormatHelper.TODateInt(this.txtPlanStartDateEdit.Text); mo.MOPlanEndDate = FormatHelper.TODateInt(this.txtPlanEndDateEdit.Text); mo.CustomerOrderNO = FormatHelper.CleanString(this.txtCustomerOrderNOEdit.Text, 40); mo.CustomerCode = FormatHelper.CleanString(this.txtCustomerCodeEdit.Text, 40); mo.MODownloadDate = FormatHelper.TODateInt(this.txtMODownloadDateEdit.Text); mo.MOUser = FormatHelper.CleanString(this.txtMOUserEdit.Text, 40); mo.MOStatus = FormatHelper.CleanString(this.drpMOStatusEdit.SelectedValue, 40); mo.MOActualStartDate = (this.txtActualStartDateEdit.Text == "") ? 0 : FormatHelper.TODateInt(this.txtActualStartDateEdit.Text); //modify by Simone mo.MOActualEndDate = (this.txtActualEndDateEdit.Text == "") ? 0 : FormatHelper.TODateInt(this.txtActualEndDateEdit.Text); mo.ItemCode = FormatHelper.CleanString(this.txtItemCodeEdit.Text, 40); mo.MaintainUser = this.GetUserCode(); mo.IsControlInput = FormatHelper.BooleanToString(this.chbLimitItemQtyEdit.Checked); mo.IDMergeRule = System.Int32.Parse(FormatHelper.CleanString(this.txtDenominatorEdit.Text)); mo.MOPendingCause = FormatHelper.CleanString(this.txtPendingCause.Text, 50); mo.MOPlanQty = System.Decimal.Parse(FormatHelper.CleanString(this.txtMOQtyEdit.Text)); mo.MOBIOSVersion = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBIOSVersion.Text)); mo.MOPCBAVersion = FormatHelper.CleanString(this.txtPCBAVersion.Text); //Laws Lu,2006/07/05 support RMA mo.RMABillCode = FormatHelper.CleanString(this.txtRMABillNo.Text); mo.IsCompareSoft = (true == this.chbBIOSVersion.Checked) ? 1 : 0; mo.BOMVersion = this.txtMOBomEdit.Text.Trim(); mo.MOMemo = FormatHelper.CleanString(this.txtMemo.Text, 100); mo.MORemark = FormatHelper.CleanString(this.txtMORemarkEdit.Text, 500); if (mo.MORemark == "") { mo.MORemark = " "; } return(mo); } else { return(null); } }