private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 InitGrid(); if (opState == OpState.Add) { model = new Equipment(); if (modelC != null) { model.EQCId = modelC.EQCId; model.cEQCCode = modelC.Code; model.cEQCName = modelC.Name; model.cMaker = Information.UserInfo.cUser_Name; model.dtOperations = dal.GetDTable(0); } lblModuleTitle.Text = "新增 - " + this.lblModuleTitle.Text; } else if (opState == OpState.Update) { model = dal.Get(EQId); model.cModifier = Information.UserInfo.cUser_Name; oldEQCode = model.cEQCode; lblModuleTitle.Text = "编辑 - " + this.lblModuleTitle.Text; } UIControl.SetStatus(tab_Main.AttachedControl, opState); UIBinding <Equipment> .UIDataBinding(panelEx1, model); Grid.DataSource = model.dtOperations; #endregion }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 if (opState == OpState.Add) { model = new MaintenancePlans(); if (eq != null) { model.EQId = eq.EQId; model.cEQCode = eq.cEQCode; model.cEQName = eq.cEQName; model.cEQCCode = eq.cEQCCode; model.cEQCName = eq.cEQCName; } model.dDate = DateTime.Now.Date; model.cMaker = Information.UserInfo.cUser_Name; lblModuleTitle.Text = "新增 - " + this.lblModuleTitle.Text; } else if (opState == OpState.Update) { model = dal.Get(AutoId); this.oldDate = model.dDate; lblModuleTitle.Text = "编辑 - " + this.lblModuleTitle.Text; } //UIControl.SetStatus(tab_Main.AttachedControl, opState); UIBinding <MaintenancePlans> .UIDataBinding(tab_Main.AttachedControl, model); #endregion }
/// <summary> /// 新建连接 /// </summary> private void CreateConnection() { //更新数据模型 UIBinding.TryUpdateModel(ModifyConn, this.Controls); //感谢 呆呆 的Bug 报告,不论txtConnectionString.Text是否存在都进行赋值,防止删除字符后,值还是保留的BUG ModifyConn.ConnectionString = txtConnectionString.Text; if (txtConnectionString.Text != string.Empty) { var strException = MongoHelper.FillConfigWithConnectionString(ref ModifyConn); if (strException != string.Empty) { MyMessageBox.ShowMessage("Url Exception", "Url Formation,please check it", strException); } } else { //仅有用户名或密码 if (txtUsername.Text != string.Empty && txtPassword.Text == string.Empty) { MessageBox.Show("Please Input Password"); return; } if (txtUsername.Text == string.Empty && txtPassword.Text != string.Empty) { MessageBox.Show("Please Input UserName"); return; } //数据库名称存在,则必须输入用户名和密码 if (txtDataBaseName.Text != string.Empty) { //用户名或者密码为空 if (txtUsername.Text == string.Empty || txtPassword.Text == string.Empty) { MessageBox.Show("Please Input UserName or Password"); return; } } if (ModifyConn.IsUseDefaultSetting) { ModifyConn.WtimeoutMs = MongoConnectionConfig.MongoConfig.WtimeoutMs; ModifyConn.WaitQueueSize = MongoConnectionConfig.MongoConfig.WaitQueueSize; ModifyConn.WriteConcern = MongoConnectionConfig.MongoConfig.WriteConcern; ModifyConn.ReadPreference = MongoConnectionConfig.MongoConfig.ReadPreference; } ModifyConn.ReplsetList = new List <string>(); if (cmbStorageEngine.SelectedIndex == 0) { ModifyConn.StorageEngine = EnumMgr.StorageEngineType.MmaPv1; } else { ModifyConn.StorageEngine = EnumMgr.StorageEngineType.WiredTiger; } foreach (string item in lstHost.Items) { ModifyConn.ReplsetList.Add(item); } } }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 if (opState == OpState.Add) { model = new Mould(); model.dtEquipment = dal.GetEqDetails(""); model.MCId = modelC.MCId; model.cMCCode = modelC.Code; model.cMCName = modelC.Name; model.cMaker = Information.UserInfo.cUser_Name; lblModuleTitle.Text = "新增 - " + this.lblModuleTitle.Text; } else if (opState == OpState.Update) { model = dal.Get(MId); model.cModifier = Information.UserInfo.cUser_Name; oldMCode = model.cMCode; lblModuleTitle.Text = "编辑 - " + this.lblModuleTitle.Text; } UIControl.SetStatus(tab_Main.AttachedControl, opState); UIBinding <Mould> .UIDataBinding(tab_Main.AttachedControl, model); #endregion }
private void FmLoad(object sender, EventArgs e) { this.InitGrid(GridRecord); UIBinding <CardMain> .UIDataBinding(panel1, Card.M); this.gridControl1.DataSource = Card.DList; }
private void btn_Cancel_Click(object sender, EventArgs e) { UIBinding <Menu> .UIDataBinding(panelEx1, currentMenu); newMenu = null; SetUIStatus(UIStatus.Browse); }
private void SetUIStatus(OpState op) { if (model != null) { UIBinding <MergeCard> .UIDataBinding(pnlMain, model); } UIControl.SetStatus(this, op); gridControl1.DataSource = model.dtDetails; }
private void FmLoad(object sender, EventArgs e) { if (model != null) { this.GridChild.AutoGenerateColumns = false; UIBinding <Model.WorkOrder> .UIDataBinding(groupBox1, model); this.LoadChildren(); this.LoadOperation(); } }
private void FmLoad(object sender, EventArgs e) { if (model != null) { UIBinding <CardMain> .UIDataBinding(groupBox1, model); this.GridDetail.AutoGenerateColumns = false; this.LoadChildren(); this.LoadOperation(); } }
private void RefreshUI() { if (model != null) { UIBinding <Routing> .UIDataBinding(panelEx2, model); Grid.DataSource = model.DtRoutings; } UIControl.SetStatus(Head_Bar, panelEx1, opState); }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 this.InitColumns(); this.dtInvDetails = dal.GetInvDetails(MId); this.Grid.DataSource = dtInvDetails; UIBinding <Mould> .UIDataBinding(panelEx1, model); #endregion }
//=========================================================================== private void btn_Add_Click(object sender, EventArgs e) { this.SetUIStatus(UIStatus.Add); newMenu = new Menu(); if (currentMenu != null) { newMenu.FNumber = currentMenu.FNumber + "."; } UIBinding <Menu> .UIDataBinding(panelEx1, newMenu); }
private void BtnDel_Click(object sender, EventArgs e) { if (MsgBox.ShowYesNoMsg("确定撤销最后一道报工记录?") == DialogResult.Yes) { Report.ReportClient rep = new Report.ReportClient(); rep.ReportCanel(Card.M.CardNo); Card = dal.Get(Card.M.CardNo); UIBinding <CardMain> .UIDataBinding(panel1, Card.M); this.gridControl1.DataSource = Card.DList; } }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 model = dal.Get(MId); this.InitColumns(); UIBinding <Mould> .UIDataBinding(panelEx1, model); Grid.DataSource = model.dtEquipment.DefaultView; model.dtEquipment.ColumnChanging += DtEquipment_ColumnChanging; #endregion }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 if (opState == OpState.Update) { oldCode = model.QMItemCode; lblModuleTitle.Text = "编辑 - " + this.lblModuleTitle.Text; } UIControl.SetStatus(Head_Bar, tab_Main.AttachedControl, opState); UIBinding <QMItem> .UIDataBinding(panelEx1, model); #endregion }
private void LoadData() { UIBinding <CardMain> .UIDataBinding(pnlM, card.M); UIBinding <CardDetail> .UIDataBinding(pnlD, card.M.curOperation); this.lbl_opMemo.Text = card.M.curOperation.cMemo; card.M.curOperation.cDepCode = card.M.MDeptCode; this.txtr_cDepName.Text = card.M.MDeptName; var preOp = dal.GetPrevious(card.M.CardNo, card.M.curOpSeq); if (preOp != null) { this.txt_qty.Text = preOp.hgQty.ToString(); this.txt_hgQty.Text = preOp.hgQty.ToString(); } }
public void InitControl() { RefreshGRPIcon(); mapDataBinding = new MapDataBinding(this); StyleChange(); LocationList.ItemsSource = mapdata.LocationDatas; LocationList.Items.SortDescriptions.Add(new SortDescription("INDEX", ListSortDirection.Ascending)); UnitPlaceList.ItemsSource = IndexedUnitList; UnitPlaceList.Items.SortDescriptions.Add(new SortDescription("INDEX", ListSortDirection.Ascending)); Scenario.Init(this); refreshLocBox(); uIBinding = new UIBinding(this); uIBinding.view_Tile = true; uIBinding.view_Unit = true; uIBinding.view_Unit_StartLoc = true; uIBinding.view_Unit_Maprevealer = true; uIBinding.view_Doodad = true; uIBinding.view_Sprite = true; Toolbar.DataContext = uIBinding; this.DataContext = mapDataBinding; UnitPallete.SetCodeType(Codetype.Unit, this); SpritePallete.SetCodeType(Codetype.Sprite, this); SpritePallete_Unit.SetCodeType(Codetype.Unit, this); UnitPallete.SelectionChanged += UnitPallete_SelectionChanged; SpritePallete.SelectionChanged += SpritePallete_SelectionChanged; SpritePallete_Unit.SelectionChanged += SpritePallete_SelectionChanged; UnitPallete.SelectIndex = 0; SpritePallete.SelectIndex = 0; SpritePallete_Unit.SelectIndex = 0; TileSetUIRefresh(); }
/// <summary> /// 初始化(修改) /// </summary> /// <param name="connectionName"></param> public FrmConnectionMgr(string connectionName) { InitializeComponent(); foreach (var item in Enum.GetValues(typeof(EnumMgr.StorageEngineType))) { cmbStorageEngine.Items.Add(item); cmbStorageEngine.SelectedIndex = 0; } OldConnectionName = connectionName; //Modify Mode ModifyConn = MongoConnectionConfig.MongoConfig.ConnectionList[connectionName]; UIBinding.TryUpdateForm(ModifyConn, this.Controls); foreach (var item in ModifyConn.ReplsetList) { lstHost.Items.Add(item); } cmbStorageEngine.SelectedIndex = ModifyConn.StorageEngine == EnumMgr.StorageEngineType.MmaPv1 ? 0 : 1; cmdAdd.Text = GuiConfig.IsUseDefaultLanguage ? "Modify" : GuiConfig.GetText(TextType.CommonModify); }
private void RefreshUI() { if (opState == OpState.Browse || opState == OpState.Audit) { if (string.IsNullOrEmpty(model.cAuditPsn)) { this.opState = OpState.Browse; } else { this.opState = OpState.Audit; } } UIControl.SetStatus(this, this.opState); UIBinding <MaterialPlan> .UIDataBinding(pnlMain, model); gridControl1.DataSource = model.dtDetails; }
private void RefreshUI() { if (model != null) { UIBinding <MaintenancePlan> .UIDataBinding(pnlMain, model); gridControl1.DataSource = model.DtBody; } UIControl.SetStatus(this.collapsibleSplitContainer1.Panel2, this.opState); UIControl.SetStatus(this, this.opState); if (opState == OpState.Add || opState == OpState.Update) { gridControl2.Enabled = false; } else { gridControl2.Enabled = true; } }
private void UIDataBinding() { UIBinding <WorkOrderDTO> .UIDataBinding(this, model); //表头数据绑定 dvRouter = model.WorkOrderRouter.DefaultView; dvDetail = model.WorkOrderDetail.DefaultView; this.gridControl2.DataSource = dvDetail; this.gridControl3.DataSource = dvRouter; repositoryItemLookUpEdit1.DataSource = model.WorkOrderRouter; repositoryItemLookUpEdit1.KeyMember = "autoid"; repositoryItemLookUpEdit1.ValueMember = "autoid"; repositoryItemLookUpEdit1.DisplayMember = "OpName"; repositoryItemLookUpEdit1.Columns.AddRange( new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] { new DevExpress.XtraEditors.Controls.LookUpColumnInfo("OpSeq", "序号"), new DevExpress.XtraEditors.Controls.LookUpColumnInfo("OpName", "工序") }); }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 if (opState == OpState.Add) { model = new QMItemClass() { cMaker = Information.UserInfo.cUser_Name }; lblModuleTitle.Text = "新增 - " + this.lblModuleTitle.Text; } else if (opState == OpState.Update) { oldCode = model.QMCCode; lblModuleTitle.Text = "编辑 - " + this.lblModuleTitle.Text; } UIControl.SetStatus(Head_Bar, tab_Main.AttachedControl, opState); UIBinding <QMItemClass> .UIDataBinding(panelEx1, model); #endregion }
private void NodeClick(object sender, EventArgs e) { currentMenu = (sender as Node).Tag as Menu; UIBinding <Menu> .UIDataBinding(panelEx1, currentMenu); }
private void UIDataBinding() { //数据绑定 UIBinding <MomOrder> .UIDataBinding(this, model); }
private void LoadData() { UIBinding <CardMain> .UIDataBinding(pnlM, cardM); UIBinding <CardDetail> .UIDataBinding(pnlD, cardM.curOperation); }
//加载流转卡数据 private void LoadCardData(string cardNo) { if (!dal.Exists(cardNo)) { throw new Exception("找不到流转卡: " + cardNo); } card = dal.Get(cardNo); if (card == null) { MsgBox.ShowInfoMsg("找不到流转卡: " + cardNo); return; } if (card.M.curOperation == null) { MsgBox.ShowInfoMsg("当前工序为空!"); return; } //istatus = 1 物料需求标识 if (card.M.curOperation.iStatus == 0) { dal.SetOperationStatus(1, card.M.curOperation.AutoId); card.M.curOperation.iStatus = 1; } UIBinding <CardMain> .UIDataBinding(pnl_Main, card.M); UIBinding <CardDetail> .UIDataBinding(lbl_dStartDate, "dStartDate", card.M.curOperation); list_children.Items.Clear(); foreach (CardChildren c in card.ZJList) { ListViewItem item = new ListViewItem(c.OpName.ToString()); item.SubItems.Add(c.cInvCode); item.SubItems.Add(c.cInvName); item.SubItems.Add(c.cInvStd); item.SubItems.Add(c.iQuantity.ToString()); item.SubItems.Add(c.rQuantity.ToString()); item.Tag = c; list_children.Items.Add(item); } switch (card.M.curOperation.iStatus) { case 1: lbl_Status.Text = "材料准备"; break; case 2: lbl_Status.Text = "材料确认"; break; case 3: lbl_Status.Text = "已开工"; break; case 4: lbl_Status.Text = "已报检"; break; case 5: lbl_Status.Text = "已检验"; break; case 6: lbl_Status.Text = "已完工"; break; } this.SetBtnGo(BtnGo); //this.SetBtnBack(btnBack); this.btnBack.Visible = card.M.curOperation.iStatus > 1; lbl_bQuality.Text = card.M.curOperation.bQuality ? "是" : "否"; lbl_bChild.Text = card.M.bChild ? "是" : "否"; lbl_QmR.Text = new QmCardOPDAL().HaveQmReport(card.M.curOperation) ? "已报检" : "未报检"; #region 加载共享文件列表 FileExpControl ctrl = new FileExpControl(cardNo); ctrl.Parent = groupPanel2; ctrl.Dock = DockStyle.Fill; ctrl.Show(); #endregion }