/// <summary> /// girdview列值改变时触发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.MaterialType materialType = this.gridView1.GetRow(e.RowHandle) as Model.MaterialType; switch (e.Column.Name) { case "gridColumnLevel": materialType.MaterialLevel = Convert.ToInt32(e.Value.ToString().Substring(0, e.Value.ToString().LastIndexOf('.'))); break; case "gridColumnIsEnd": if ((bool)e.Value) { foreach (Model.MaterialType material in this._detail) { material.EndMaterialTypeLogo = false; } } materialType.EndMaterialTypeLogo = (bool)e.Value; this.gridControl1.RefreshDataSource(); break; case "gridColumnName": materialType.MaterialTypeName = e.Value.ToString(); break; case "gridColumnDesc": materialType.MaterialTypeDescription = e.Value.ToString(); break; } }
public void Delete(Model.MaterialType materialType) { // // todo:add other logic here // accessor.Delete(materialType.MaterialTypeID); }
private void Validate(Model.MaterialType materialType) { if (string.IsNullOrEmpty(materialType.MaterialTypeName)) { throw new Helper.RequireValueException(Model.MaterialType.PROPERTY_MATERIALTYPENAME); } }
/// <summary> /// /// </summary> /// <param name="item"></param> public void MyClick(ref ChooseItem item) { ChooseMaterialTypeForm f = new ChooseMaterialTypeForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.MaterialType MaterialType = f.SelectedItem as Model.MaterialType; item = new ChooseItem(MaterialType, MaterialType.Id, MaterialType.MaterialTypeName); } }
/// <summary> /// Insert a MaterialType. /// </summary> public void Insert(Model.MaterialType materialType) { // // todo:add other logic here // // Validate(materialType); // materialType.MaterialTypeID = Guid.NewGuid().ToString(); materialType.InsertTime = DateTime.Now; materialType.UpdateTime = DateTime.Now; accessor.Insert(materialType); }
public void MyLeave(ref ChooseItem item) { BL.MaterialTypeManager manager = new Book.BL.MaterialTypeManager(); Model.MaterialType MaterialType = manager.GetById(item.ButtonText); if (MaterialType != null) { item.EditValue = MaterialType; item.LabelText = MaterialType.MaterialTypeName; item.ButtonText = MaterialType.Id; } else { item.ErrorMessage = "物料類型錯誤"; } }
public Model.MaterialType GetNext(Model.MaterialType e) { return(accessor.GetNext(e)); }
public Model.MaterialType GetPrev(Model.MaterialType e) { return(accessor.GetPrev(e)); }
public bool HasRowsAfter(Model.MaterialType e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.MaterialType e) { return(accessor.HasRowsBefore(e)); }
public bool ExistsExcept(Model.MaterialType e) { return(accessor.ExistsExcept(e)); }