StorefrontOutlaySetSmallForm.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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. namespace LYFZ.Software.MainBusiness.FinancialManagement.SetSmallForm
  10. {
  11. public partial class StorefrontOutlaySetSmallForm : LYFZ.Software.UI.FinancialManagement.SetSmallForm.StorefrontOutlayEnterSetSmallForm
  12. {
  13. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  14. LYFZ.BLL.BLL_ErpSystemCategory scbll = new BLL.BLL_ErpSystemCategory();
  15. LYFZ.BLL.BLL_ErpOtherIncomeAndExpenses oiebll = new BLL.BLL_ErpOtherIncomeAndExpenses();
  16. public StorefrontOutlaySetSmallForm()
  17. {
  18. this.Load += StorefrontOutlaySetSmallForm_Load;
  19. this.Shown += StorefrontOutlaySetSmallForm_Shown;
  20. this.btnSave.Click += btnSave_Click;
  21. this.btnCancel.Click += btnCancel_Click;
  22. this.btnSet.Click += btnSet_Click;
  23. this.btnSetPay.Click += btnSetPay_Click;
  24. this.btnUpdateTime.Click += btnUpdateTime_Click;
  25. this.btnSelect.Click += btnSelect_Click;
  26. this.btnDelete.Click += btnDelete_Click;
  27. this.pictPhoto.MouseDoubleClick += pictPhoto_MouseDoubleClick;
  28. this.txtOiae_Money.KeyPress += txtOiae_Money_KeyPress;
  29. }
  30. public enum OutlayLoadType
  31. {
  32. 店面支出,
  33. 财务支出
  34. }
  35. public enum OutlayInputType
  36. {
  37. 添加,
  38. 修改
  39. }
  40. public int OutlayID = 0;
  41. public OutlayLoadType EnumOutlayLoadType;
  42. public OutlayInputType EnumOutlayInputType;
  43. public bool IsSaveed = false;
  44. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  45. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  46. string StrServerPath = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TCP_FinancialOutlayReceipt();
  47. /// <summary>
  48. /// 窗体加载事件
  49. /// </summary>
  50. /// <param name="sender"></param>
  51. /// <param name="e"></param>
  52. void StorefrontOutlaySetSmallForm_Load(object sender, EventArgs e)
  53. {
  54. switch (EnumOutlayInputType)
  55. {
  56. case OutlayInputType.添加:
  57. //this.panelPict.Visible = false;
  58. //this.Height -= this.panelPict.Height;
  59. break;
  60. case OutlayInputType.修改:
  61. break;
  62. }
  63. }
  64. /// <summary>
  65. /// 窗体加载事件
  66. /// </summary>
  67. /// <param name="sender"></param>
  68. /// <param name="e"></param>
  69. void StorefrontOutlaySetSmallForm_Shown(object sender, EventArgs e)
  70. {
  71. // 部门人员绑定
  72. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.txtTsorder_OpenSingle, IsFirstNodeNull: true, IsShowResign: false);
  73. // 支付方式
  74. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_PaymentMethod(this.cmbPay_PaymentMethod, IsShowAll: false);
  75. // 费用类别
  76. switch (EnumOutlayLoadType)
  77. {
  78. case OutlayLoadType.财务支出:
  79. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BFAGBGBAEJBACEEHJ", this.CtvTsorder_Name, IsFirstNodeNull: false);
  80. break;
  81. case OutlayLoadType.店面支出:
  82. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBACIAFBEDIGJJFE", this.CtvTsorder_Name, IsFirstNodeNull: false);
  83. break;
  84. }
  85. this.txtOiae_IEDatetime.Text = SDateTime.Now.ToString();
  86. this.txtOiae_PersonHandling.Text = this.StrUserName;
  87. LYFZ.Model.Model_ErpOtherIncomeAndExpenses model = oiebll.GetModel(this.OutlayID);
  88. if (model.ID > 0)
  89. {
  90. this.btnUpdateTime.Visible = false;
  91. this.CtvTsorder_Name.TextFindTag(model.Oiae_ProjectName);
  92. this.txtTsorder_OpenSingle.TagFindText(model.Oiae_ThePayer);
  93. this.txtOiae_Money.Text = model.Oiae_Money.ToString("n2");
  94. this.txtOiae_IEDatetime.Text = LYFZ.Command.Command_Validate.DateTimeToString(model.Oiae_IEDatetime);
  95. this.txtOiae_IEDatetime.Tag = model.Oiae_IEDatetime;
  96. this.txtOiae_PersonHandling.Text = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(model.Oiae_PersonHandling)["User_Name"].ToString().Trim();
  97. this.txtOiae_Remark.Text = model.Oiae_Remark;
  98. this.cmbPay_PaymentMethod.TagFindText(model.Oiae_PaymentMethod);
  99. if (!string.IsNullOrEmpty(model.Oiae_Invoice))
  100. {
  101. this.pictPhoto.BeginInvoke((Action)delegate()
  102. { this.pictPhoto.Image = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(model.Oiae_Invoice)); });
  103. }
  104. else
  105. {
  106. System.Threading.ThreadPool.QueueUserWorkItem(delegate
  107. {
  108. string retmsg = "";
  109. Bitmap retBmp_Jobs = null;
  110. try
  111. {
  112. retmsg = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.DownloadBitmap(ref retBmp_Jobs, StrServerPath + "\\" + model.ID + ".jpg");
  113. }
  114. catch (Exception ex)
  115. { retmsg = ex.Message; }
  116. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  117. {
  118. try
  119. { this.pictPhoto.Image = retBmp_Jobs; }
  120. catch
  121. { }
  122. }));
  123. });
  124. }
  125. }
  126. ///控制财务管理扫码支付的版本权
  127. List<Control> hideControl = new List<Control>();
  128. hideControl.Add(cmbPay_PaymentMethod);
  129. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(VersionControl.VersionFunctionEnum.财务管理扫码支付, hideControl, null, null);
  130. }
  131. /// <summary>
  132. /// 保存
  133. /// </summary>
  134. /// <param name="sender"></param>
  135. /// <param name="e"></param>
  136. void btnSave_Click(object sender, EventArgs e)
  137. {
  138. #region 判断不能为空
  139. if (string.IsNullOrEmpty(this.CtvTsorder_Name.Text))
  140. { MessageBoxCustom.Show("项目名称不能为空!"); return; }
  141. if (string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text))
  142. { MessageBoxCustom.Show("支付方式不能为空!"); return; }
  143. if (string.IsNullOrEmpty(this.txtOiae_Money.Text))
  144. { MessageBoxCustom.Show("金额不能为空!"); return; }
  145. try
  146. {
  147. Convert.ToDecimal(this.txtOiae_Money.Text);
  148. }
  149. catch (Exception ex)
  150. { MessageBoxCustom.Show("金额输入不正确定!" + ex.Message.Trim()); }
  151. if (string.IsNullOrEmpty(this.txtOiae_IEDatetime.DateValue))
  152. { MessageBoxCustom.Show("日期不能为空!"); return; }
  153. if (string.IsNullOrEmpty(this.txtTsorder_OpenSingle.Text))
  154. { MessageBoxCustom.Show("经手人不能为空!"); return; }
  155. #endregion
  156. LYFZ.Model.Model_ErpOtherIncomeAndExpenses model = null;
  157. if (this.OutlayID <= 0)
  158. {
  159. DateTime StrTime = SDateTime.Now;
  160. model = new Model.Model_ErpOtherIncomeAndExpenses();
  161. switch (this.EnumOutlayLoadType)
  162. {
  163. case OutlayLoadType.财务支出: model.Oiae_Type = "财务支出"; break;
  164. case OutlayLoadType.店面支出: model.Oiae_Type = "支出"; break;
  165. }
  166. model.Oiae_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  167. model.Oiae_ProjectName = this.CtvTsorder_Name.Text.Trim();
  168. model.Oiae_Money = Convert.ToDecimal(this.txtOiae_Money.Text);
  169. model.Oiae_IEDatetime = Convert.ToDateTime(this.txtOiae_IEDatetime.DateTimeValue);
  170. model.Oiae_PersonHandling = this.StrUserID;
  171. if (string.IsNullOrEmpty(this.txtTsorder_OpenSingle.Text.Trim()))
  172. { model.Oiae_ThePayer = ""; }
  173. else
  174. { model.Oiae_ThePayer = this.txtTsorder_OpenSingle.Tag.ToString().Trim(); }
  175. model.Oiae_Invoice = "";
  176. model.Oiae_SourceType = 0;
  177. model.Oiae_OrderNumber = "";
  178. model.Oiae_Remark = this.txtOiae_Remark.Text.Trim();
  179. model.Oiae_CreateDateTime = StrTime;
  180. model.Oiae_PaymentMethod = this.cmbPay_PaymentMethod.Tag.ToString();
  181. model.Oiae_FinancialAuditState = "未审核";
  182. model.Oiae_ManagerAuditState = "未审核";
  183. model.Oiae_CEOAuditState = "未审核";
  184. if (oiebll.Add(model))
  185. {
  186. this.IsSaveed = true;
  187. DataTable tbl = orbll.GetView_Custom("tb_ErpOtherIncomeAndExpenses", StrWhere: "Oiae_ProjectName = '" + this.CtvTsorder_Name.Text.Trim() + "' And Oiae_IEDatetime = '" + this.txtOiae_IEDatetime.DateTimeValue + "' And Oiae_CreateDateTime = '" + StrTime.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' And Oiae_PersonHandling = '" + this.StrUserID + "'", ShowColumnName: "ID").Tables[0];
  188. if (tbl.Rows.Count > 0)
  189. { this.UpDataPhotoImage(tbl.Rows[0]["ID"].ToString().Trim()); }
  190. MessageBoxCustom.Show("保存成功!可继续录入资料!");
  191. this.CtvTsorder_Name.Text = "";
  192. this.txtTsorder_OpenSingle.Text = "";
  193. this.txtOiae_Money.Text = "";
  194. this.txtOiae_IEDatetime.Text = "";
  195. this.txtOiae_IEDatetime.Tag = null;
  196. this.txtOiae_Remark.Text = "";
  197. }
  198. else
  199. { MessageBoxCustom.Show("保存失败!"); }
  200. }
  201. else
  202. {
  203. model = oiebll.GetModel(this.OutlayID);
  204. model.Oiae_ProjectName = this.CtvTsorder_Name.Text;
  205. model.Oiae_Money = Convert.ToDecimal(this.txtOiae_Money.Text);
  206. if (Convert.ToDateTime(this.txtOiae_IEDatetime.Tag).ToString("yyyy-MM-dd") != this.txtOiae_IEDatetime.DateValue.Trim())
  207. { model.Oiae_IEDatetime = Convert.ToDateTime(this.txtOiae_IEDatetime.DateTimeValue); }
  208. if (string.IsNullOrEmpty(this.txtTsorder_OpenSingle.Text))
  209. { model.Oiae_ThePayer = ""; }
  210. else
  211. { model.Oiae_ThePayer = this.txtTsorder_OpenSingle.Tag.ToString(); }
  212. model.Oiae_Invoice = "";
  213. model.Oiae_Remark = this.txtOiae_Remark.Text;
  214. //model.Oiae_Invoice = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ToHexString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImageDatabytes(this.pictPhoto));
  215. model.Oiae_PaymentMethod = this.cmbPay_PaymentMethod.Tag.ToString();
  216. model.Oiae_UpdateDateTime = SDateTime.Now;
  217. model.Oiae_UpdateName = StrUserID;
  218. if (oiebll.Update(model))
  219. {
  220. this.UpDataPhotoImage(model.ID.ToString().Trim());
  221. this.IsSaveed = true;
  222. MessageBoxCustom.Show("修改成功!");
  223. }
  224. else
  225. { MessageBoxCustom.Show("修改失败!"); }
  226. }
  227. }
  228. void UpDataPhotoImage(string StrID)
  229. {
  230. if (this.pictPhoto.Image != null)
  231. {
  232. if (this.labelEx6.ForeColor == Color.Red)
  233. {
  234. Bitmap bmp = new Bitmap(this.pictPhoto.Image);
  235. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  236. {
  237. backgroundWorker.ReportProgress(0, "正在连接服务器...");
  238. try
  239. {
  240. string ret = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.UploadFileToServer(bmp, System.Drawing.Imaging.ImageFormat.Jpeg, StrServerPath + "\\" + StrID + ".jpg", backgroundWorker);
  241. if (ret.IndexOf("成功") == -1)
  242. { MessageBoxCustom.Show(ret, backgroundWorker: backgroundWorker); return; }
  243. }
  244. catch
  245. { }
  246. });
  247. }
  248. }
  249. else if (this.IsDeletePhoto)
  250. {
  251. try
  252. {
  253. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  254. { string ret = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.DeleteFile(StrServerPath + "\\" + StrID + ".jpg", backgroundWorker); });
  255. }
  256. catch
  257. { }
  258. this.IsDeletePhoto = false;
  259. }
  260. this.labelEx6.ForeColor = System.Drawing.Color.FromArgb(119, 113, 114);
  261. }
  262. /// <summary>
  263. /// 取消
  264. /// </summary>
  265. /// <param name="sender"></param>
  266. /// <param name="e"></param>
  267. void btnCancel_Click(object sender, EventArgs e)
  268. { this.Close(); }
  269. /// <summary>
  270. /// 设置项目
  271. /// </summary>
  272. /// <param name="sender"></param>
  273. /// <param name="e"></param>
  274. void btnSet_Click(object sender, EventArgs e)
  275. {
  276. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  277. switch (EnumOutlayLoadType)
  278. {
  279. case OutlayLoadType.财务支出:
  280. frm.TypeName = "BFAGBGBAEJBACEEHJ";
  281. frm.Version = "Version";
  282. if (frm.ShowDialog() == DialogResult.OK)
  283. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BFAGBGBAEJBACEEHJ", this.CtvTsorder_Name, IsFirstNodeNull: false); }
  284. break;
  285. case OutlayLoadType.店面支出:
  286. frm.TypeName = "BEBACIAFBEDIGJJFE";
  287. frm.Version = "Version";
  288. if (frm.ShowDialog() == DialogResult.OK)
  289. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBACIAFBEDIGJJFE", this.CtvTsorder_Name, IsFirstNodeNull: false); }
  290. break;
  291. }
  292. }
  293. /// <summary>
  294. /// 设置支付方式
  295. /// </summary>
  296. /// <param name="sender"></param>
  297. /// <param name="e"></param>
  298. void btnSetPay_Click(object sender, EventArgs e)
  299. {
  300. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  301. frm.TypeName = "BEBACCAFCCEAGAIHH";
  302. frm.Version = "Version";
  303. if (frm.ShowDialog() == DialogResult.OK)
  304. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_PaymentMethod(this.txtTsorder_OpenSingle, IsShowAll: false); }
  305. }
  306. /// <summary>
  307. /// 修改时间
  308. /// </summary>
  309. /// <param name="sender"></param>
  310. /// <param name="e"></param>
  311. void btnUpdateTime_Click(object sender, EventArgs e)
  312. {
  313. switch (EnumOutlayLoadType)
  314. {
  315. case OutlayLoadType.财务支出:
  316. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.FinancialExpensesCompetence, CustomAttributes.OperatingAuthority.UpdatePaymentTime))
  317. { this.txtOiae_IEDatetime.Enabled = true; }
  318. else
  319. {
  320. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm("FinancialExpensesCompetence", CustomAttributes.OperatingAuthority.UpdatePaymentTime);
  321. if (frm.ShowDialog() == DialogResult.OK)
  322. {
  323. if (LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.FinancialExpensesCompetence, CustomAttributes.OperatingAuthority.UpdatePaymentTime, frm.User_BelongRoles))
  324. {
  325. frm.SetAuthorizationResult();
  326. this.txtOiae_IEDatetime.Enabled = true; }
  327. else {
  328. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'{0}'权限", LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm.ConvertEnumToDescription(CustomAttributes.OperatingAuthority.UpdatePaymentTime).ToString()));
  329. }
  330. }
  331. }
  332. break;
  333. case OutlayLoadType.店面支出:
  334. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CashExpendituresCompetence, CustomAttributes.OperatingAuthority.UpdatePaymentTime))
  335. { this.txtOiae_IEDatetime.Enabled = true; }
  336. else
  337. {
  338. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm("CashExpendituresCompetence", CustomAttributes.OperatingAuthority.UpdatePaymentTime);
  339. if (frm.ShowDialog() == DialogResult.OK)
  340. {
  341. if (LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.CashExpendituresCompetence, CustomAttributes.OperatingAuthority.UpdatePaymentTime, frm.User_BelongRoles))
  342. {
  343. frm.SetAuthorizationResult();
  344. this.txtOiae_IEDatetime.Enabled = true; }
  345. else {
  346. frm.SetAuthorizationResult(String.Format("授权失败,授权人没有'{0}'权限", LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm.ConvertEnumToDescription(CustomAttributes.OperatingAuthority.UpdatePaymentTime).ToString()));
  347. }
  348. }
  349. }
  350. break;
  351. }
  352. //if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersReceivablesCompetence, CustomAttributes.OperatingAuthority.UpdatePaymentTime))
  353. //{ this.txtOiae_IEDatetime.Enabled = true; }
  354. //else
  355. //{
  356. // LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm();
  357. // if (frm.ShowDialog() == DialogResult.OK)
  358. // {
  359. // if (LYFZ.BLL.BLL_ErpUser.GetRights(frm.CurrentAuthorizeUserRights.OrdersReceivablesCompetence, CustomAttributes.OperatingAuthority.UpdatePaymentTime, frm.User_BelongRoles))
  360. // { this.txtOiae_IEDatetime.Enabled = true; }
  361. // }
  362. //}
  363. }
  364. /// <summary>
  365. /// 浏览
  366. /// </summary>
  367. /// <param name="sender"></param>
  368. /// <param name="e"></param>
  369. void btnSelect_Click(object sender, EventArgs e)
  370. {
  371. OpenFileDialog OpenFile = new OpenFileDialog();
  372. OpenFile.Filter = "图片文件(*.jpg)|*.jpg|图片文件(*.gif)|*.gif|图片文件(*.bmp)|*.bmp|图片文件(*.png)|*.png";
  373. OpenFile.FileName = "";
  374. if (OpenFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  375. {
  376. this.labelEx6.ForeColor = Color.Red;
  377. this.pictPhoto.Tag = OpenFile.FileName;
  378. this.pictPhoto.Image = LYFZ.BLL.SelectPhotoHandling.GeneratePreviewBitmap(OpenFile.FileName, 600, 800);
  379. }
  380. }
  381. bool IsDeletePhoto = false;
  382. /// <summary>
  383. /// 删除
  384. /// </summary>
  385. /// <param name="sender"></param>
  386. /// <param name="e"></param>
  387. void btnDelete_Click(object sender, EventArgs e)
  388. {
  389. LYFZ.Model.Model_ErpOtherIncomeAndExpenses model = oiebll.GetModel(this.OutlayID);
  390. model.Oiae_Invoice = "";
  391. if (oiebll.Update(model))
  392. {
  393. this.IsDeletePhoto = true;
  394. this.pictPhoto.Image = null;
  395. this.pictPhoto.Tag = null;
  396. }
  397. }
  398. /// <summary>
  399. /// 双击查看图片
  400. /// </summary>
  401. /// <param name="sender"></param>
  402. /// <param name="e"></param>
  403. void pictPhoto_MouseDoubleClick(object sender, MouseEventArgs e)
  404. {
  405. if (this.OutlayID > 0)
  406. {
  407. LYFZ.Software.MainBusiness.FinancialManagement.SetSmallForm.PhotoZoomSetSmallForm frm = new PhotoZoomSetSmallForm();
  408. frm.PhotoImage = this.pictPhoto.Image;
  409. frm.ShowDialog();
  410. }
  411. }
  412. /// <summary>
  413. /// 金额限制输入
  414. /// </summary>
  415. /// <param name="sender"></param>
  416. /// <param name="e"></param>
  417. void txtOiae_Money_KeyPress(object sender, KeyPressEventArgs e)
  418. {
  419. if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && !Char.IsControl(e.KeyChar))
  420. { e.Handled = true; }
  421. else if (Char.IsPunctuation(e.KeyChar))
  422. {
  423. if (e.KeyChar == '.')
  424. {
  425. if (((System.Windows.Forms.TextBox)sender).Text.LastIndexOf('.') != -1)
  426. { e.Handled = true; }
  427. }
  428. else if (e.KeyChar == '-')
  429. {
  430. if (((System.Windows.Forms.TextBox)sender).Text.LastIndexOf('-') != -1)
  431. { e.Handled = true; }
  432. }
  433. else
  434. { e.Handled = true; }
  435. }
  436. }
  437. }
  438. }