| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;using Pur.Entity;
- using Pur.Entity.configureEntity;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm;
- using com.hnshituo.pur.vo;
- using Pur.Entity;
- namespace Pur.configure
- {
- public partial class FrmPurTitle : FrmPmsBase
- {
- public FrmPurTitle()
- {
- InitializeComponent();
- }
- //菜单按钮事件
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- GetPUR_TITLE();
- break;
- case "Add":
- AddPUR_TITLE();
- break;
- case "Update":
- UpdPUR_TITLE();
- break;
- case "Delete":
- DelPUR_TITLE();
- break;
- }
- }
- private void DelPUR_TITLE()
- {
- Title Ti = new Title();
- Ti.Id = txt_id.Text;
- Ti.Validflag = "0";
- Ti.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- Ti.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- Ti.DeleteTime = DateTime.Now;
- CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.configure.service.TitleService", "doUpdate", new object[] { Ti });
- if (rt.Resultcode != 0)
- {
- Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("删除失败!" + rt.Resultmsg);
- return;
- }
- Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("删除成功!");
- GetPUR_TITLE();
- }
- private void UpdPUR_TITLE()
- {
- Title Ti = new Title();
- Ti.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- Ti.UpdateTime = DateTime.Now;
- Ti.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- Ti.OrgId = txt_OrgId.Text;
- Ti.OrgName = txt_OrgName.Text;
- Ti.Remark = txt_Remark.Text;
- Ti.TitleAddr = txt_TitleAddr.Text;
- Ti.TitleBankAccount = txt_TitleBankAccount.Text;
- Ti.TitleBankName = txt_TitleBankName.Text;
- Ti.TitleContactFax = txt_TitleContactFax.Text;
- Ti.TitleContactTel = txt_TitleContactTel.Text;
- Ti.TitleLinkMan = txt_TitleLinkMan.Text;
- Ti.TitleName = txt_TitleName.Text;
- Ti.TitlePostal = txt_TitlePostal.Text;
- Ti.TitleTaxId = txt_TitleTaxId.Text;
- Ti.Id = txt_id.Text;
- CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.configure.service.TitleService", "doUpdate", new object[] { Ti });
- if (rt.Resultcode != 0)
- {
- Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("修改失败!" + rt.Resultmsg);
- return;
- }
-
- Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("修改成功!");
- GetPUR_TITLE();
- }
- private void AddPUR_TITLE()
- {
- Title Ti = new Title();
- Ti.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- Ti.CreateTime = DateTime.Now;
- Ti.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- Ti.OrgId = txt_OrgId.Text;
- Ti.OrgName = txt_OrgName.Text;
- Ti.Remark = txt_Remark.Text;
- Ti.TitleAddr = txt_TitleAddr.Text;
- Ti.TitleBankAccount = txt_TitleBankAccount.Text;
- Ti.TitleBankName = txt_TitleBankName.Text;
- Ti.TitleContactFax = txt_TitleContactFax.Text;
- Ti.TitleContactTel = txt_TitleContactTel.Text;
- Ti.TitleLinkMan = txt_TitleLinkMan.Text;
- Ti.TitleName = txt_TitleName.Text;
- Ti.TitlePostal = txt_TitlePostal.Text;
- Ti.TitleTaxId = txt_TitleTaxId.Text;
- Ti.Validflag = "1";
- // Ti.Id = txt_id.Text;
- CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.configure.service.TitleService", "insert_Title", new object[] { Ti });
- if (rt.Resultcode != 0)
- {
- Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("新增失败!"+rt.Resultmsg);
- return;
- }
- Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("新增成功!");
- GetPUR_TITLE();
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void GetPUR_TITLE()
- {
- Title Ti = new Title();
- Ti.Validflag = "1";
- Ti.Id = COPID.Text;
- Ti.TitleName = COPName.Text;
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.TitleService", "find", new object[] { Ti, 0, 0 });
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- }
- //private void txt_OrgId_MouseClick(object sender, MouseEventArgs e)
- //{
- // frmdepartment fdt = new frmdepartment(ob);
- // fdt.StartPosition = FormStartPosition.Manual;
- // fdt.Location = new Point(Cursor.Position.X, Cursor.Position.Y - fdt.Height);
- // fdt.ShowDialog();
- // if (fdt.BuyerUnitDesc == null)
- // return;
- // txt_OrgName.Text = fdt.BuyerUnitDesc;
- // txt_OrgId.Text = fdt.BuyerUnitCode;
- //}
- /// <summary>
- /// 点击行事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e)
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- Title Ti = this.execute<Title>("com.hnshituo.pur.configure.service.TitleService", "findById", new object[] { uge.Cells["id"].Value.ToString() });
- txt_OrgId.Text = Ti.OrgId;
- txt_OrgName.Text = Ti.OrgName;
- txt_Remark.Text = Ti.Remark;
- txt_TitleAddr.Text = Ti.TitleAddr;
- txt_TitleBankAccount.Text = Ti.TitleBankAccount;
- txt_TitleBankName.Text = Ti.TitleBankName;
- txt_TitleContactFax.Text = Ti.TitleContactFax;
- txt_TitleContactTel.Text = Ti.TitleContactTel;
- txt_TitleLinkMan.Text = Ti.TitleLinkMan;
- txt_TitleName.Text = Ti.TitleName;
- txt_TitlePostal.Text = Ti.TitlePostal;
- txt_TitleTaxId.Text = Ti.TitleTaxId;
- txt_id.Text = Ti.Id;
- }
- private void FrmPurTitle_Load(object sender, EventArgs e)
- {
- GetPUR_TITLE();
- }
- /// <summary>
- /// 机构弹窗
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void txt_OrgId_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- frmdepartment fdt = new frmdepartment(ob);
- fdt.StartPosition = FormStartPosition.Manual;
- fdt.Location = new Point(Cursor.Position.X, Cursor.Position.Y - fdt.Height);
- fdt.ShowDialog();
- if (fdt.BuyerUnitDesc == null)
- return;
- txt_OrgName.Text = fdt.BuyerUnitDesc;
- txt_OrgId.Text = fdt.BuyerUnitCode;
- }
- private void ultraGroupBox1_Click(object sender, EventArgs e)
- {
- }
- }
- }
|