示例#1
0
        /// <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;
            }
        }
示例#2
0
 public void Delete(Model.MaterialType materialType)
 {
     //
     // todo:add other logic here
     //
     accessor.Delete(materialType.MaterialTypeID);
 }
示例#3
0
 private void Validate(Model.MaterialType materialType)
 {
     if (string.IsNullOrEmpty(materialType.MaterialTypeName))
     {
         throw new Helper.RequireValueException(Model.MaterialType.PROPERTY_MATERIALTYPENAME);
     }
 }
示例#4
0
        /// <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);
            }
        }
示例#5
0
 /// <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);
 }
示例#6
0
 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 = "物料類型錯誤";
     }
 }
示例#7
0
 public Model.MaterialType GetNext(Model.MaterialType e)
 {
     return(accessor.GetNext(e));
 }
示例#8
0
 public Model.MaterialType GetPrev(Model.MaterialType e)
 {
     return(accessor.GetPrev(e));
 }
示例#9
0
 public bool HasRowsAfter(Model.MaterialType e)
 {
     return(accessor.HasRowsAfter(e));
 }
示例#10
0
 public bool HasRowsBefore(Model.MaterialType e)
 {
     return(accessor.HasRowsBefore(e));
 }
示例#11
0
 public bool ExistsExcept(Model.MaterialType e)
 {
     return(accessor.ExistsExcept(e));
 }