CSBaseForm_DialogBill_V2018使用

  1 using System;
  2 using System.Collections.Generic;
  3 using System.ComponentModel;
  4 using System.Data;
  5 using System.Drawing;
  6 using System.Linq;
  7 using System.Text;
  8 using System.Windows.Forms;
  9 
 10 using ColdStone.Common;
 11 
 12 namespace H6BaseForm.基础资料.物料资料
 13 {
 14     public partial class MaterialAccForm : HZSoft.BaseForm.CSBaseForm_DialogBill_V2018
 15     {
 16         public MaterialAccForm()
 17         {
 18             InitializeComponent();
 19 
 20             this.Btn过滤 = DevExpress.XtraBars.BarItemVisibility.Always;
 21             this.Btn列表 = DevExpress.XtraBars.BarItemVisibility.Always;
 22         }
 23         private void MaterialAccForm_Load(object sender, EventArgs e)
 24         {
 25             if (!this.DesignMode)
 26             {
 27                 this.IniBaseForm(this.gridControlList);
 28                 
 29 
 30                 //数据绑定
 31                 //txt单据号.DataBindings.Add("EditValue", bindingSource, "Code", true, DataSourceUpdateMode.OnValidation);
 32                 //txt单据号.Tag = "000";
 33 
 34             }
 35         }
 36 
 37 
 38         #region 审核
 39 
 40         #endregion
 41         
 42 
 43         #region 自定义菜单
 44         protected override bool Fun新增()
 45         {
 46             return base.Fun新增();
 47         }
 48         protected override bool Fun删除()
 49         {
 50             if (new H6Bll.OutProduct.BllOutProductBill().Delete(drvCurrent["Id"].Hz_TypeChange_ToInt()) == 1)
 51             {
 52                 bindingSource.RemoveCurrent();
 53             }
 54             return base.Fun删除();
 55         }
 56         protected override bool Fun修改()
 57         {
 58             return base.Fun修改();
 59         }
 60         protected override bool Fun打印(ref DataSet ds)
 61         {
 62             //ds = new H6Bll.OutProduct.BllOutProductBill().Print_OutProductBill(drvCurrent["Code"].Hz_TypeChange_ToString());
 63             return true;
 64         }
 65         #endregion
 66 
 67         #region 扩展
 68 
 69         protected override void btn扩展_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 70         {
 71             switch (e.Item.Name)
 72             {
 73                 case "btn扩展0":
 74                     Fun扩展0();
 75                     break;
 76                 case "btn扩展1":
 77                     Fun扩展1();
 78                     break;
 79                 default:
 80                     break;
 81 
 82             }
 83             base.btn扩展_ItemClick(sender, e);
 84         }
 85 
 86         /// <summary>
 87         /// 外加工预付款
 88         /// </summary>
 89         private void Fun扩展0()
 90         {
 91             
 92         }
 93 
 94         private void Fun扩展1()
 95         {
 96             
 97         }
 98 
 99         #endregion
100         
101 
102 
103         #region List
104         protected override bool BindList()
105         {
106             //bindingSource.DataSource = new H6Bll.OutProduct.BllOutProductBill().QueryOutProductBill(dateQuery1.StartDate, dateQuery1.EndDate);
107             //gridView1.BestFitColumns();
108             return base.BindList();
109         }
110         protected override void FunShowDetail()
111         {   
112 
113             base.FunShowDetail();
114         }
115 
116         #endregion
117 
118         #region baseInfo
119         private void btn保存_Click(object sender, EventArgs e)
120         {
121             H6Bll.OutProduct.BllOutProductBill bllOutProductBill = new H6Bll.OutProduct.BllOutProductBill();
122             LinqSql.H6_OutProductBill modelOutProductBill = null;
123             if (this.EditMode == HZSoft.BaseForm.HZEDITMODEL.新增)
124             {
125                 modelOutProductBill = new LinqSql.H6_OutProductBill();
126             }
127             else if (this.EditMode == HZSoft.BaseForm.HZEDITMODEL.修改)
128             {
129                 modelOutProductBill = bllOutProductBill.GetModelByPK(drvCurrent["Id"].Hz_TypeChange_ToInt());
130             }
131             
132             //
133             //
134             //
135             //
136             
137             if (this.EditMode == HZSoft.BaseForm.HZEDITMODEL.新增)
138             {
139                 modelOutProductBill.Code = HZBll.CommonFunction.GetAutoBillCode("OutProductBillCode_CY", "H6_OutProductBill", "Code");
140                 modelOutProductBill.BuilderCode = HZLinq.HZData.HZDataValue.ModelUser.LoginCode;
141                 modelOutProductBill.BuildDate = HZLinq.HZData.HZDataValue.GetNowDate();
142                 if (!bllOutProductBill.InsertModel(modelOutProductBill))
143                 {
144                     DevExpress.XtraEditors.XtraMessageBox.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
145                     return;
146                 }
147                 this.EditMode = HZSoft.BaseForm.HZEDITMODEL.修改;
148             }
149             else if (this.EditMode == HZSoft.BaseForm.HZEDITMODEL.修改)
150             {
151                 if (!bllOutProductBill.UpdateModel())
152                 {
153                     DevExpress.XtraEditors.XtraMessageBox.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
154                     return;
155                 }
156 157             DevExpress.XtraEditors.XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
158             drvCurrent["Code"] = modelOutProductBill.Code;
159             drvCurrent["状态"] = "编辑中";
160             drvCurrent["Id"] = modelOutProductBill.ID;
161         }
162       
163 
164         #endregion
165 
166         #region ListDetail
167         
168 
169         #endregion
170 
171 
172         #region Detail
173         protected override bool BindDetail(string tabName)
174         {
175             switch (tabName)
176             {
177                 case "tab明细信息":
178                     break;
179                 default:
180                     break;
181             }
182             return base.BindDetail(tabName);
183         }
184         #endregion
185 
186         
187 
188     }
189 }

 

posted @ 2016-12-19 09:18  冷石  阅读(104)  评论(0)    收藏  举报