Example #1
0
        // 验证用户名是否存在
        private void txtUserName_Validating(object sender, CancelEventArgs e)
        {
            if (btnFromClosed.Focused)
            {
                return;
            }
            if (txtUserName.Text.ToString().Trim() != string.Empty)
            {
                this.txtUserName.Text = txtUserName.Text.ToString().PadLeft(5, '0');
            }
            else
            {
                UserNameLab.Text = string.Empty;
            }

            string UserNameck = Function.ComForm.strUserName = txtUserName.Text.Trim().Replace("'", "");

            if (UserNameck != string.Empty)
            {
                DataTable dt = _bllfmd020.YongHuMima_GetCorN(ComForm.strUserName);
                if (dt.Rows.Count > 0)
                {
                    this.txtUserName.Text = dt.Rows[0]["UserName"].ToString();
                    this.UserNameLab.Text = dt.Rows[0]["XM"].ToString();
                }
                else
                {
                    this.txtUserName.Text = UserNameLab.Text = string.Empty;
                    ComForm.DspMsg("W034", "");
                    txtUserName.Focus();
                    return;
                }
                dt.Clear();
            }
        }
Example #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //验证所添加的是不是全为空(2012/11/02)
                if ((string.IsNullOrEmpty(this.txtPass.Text.Trim()) == true
                     ||
                     string.IsNullOrEmpty(this.txtPass_YZ.Text.Trim()) == true
                     )
                    ||

                    this.txtPass_YZ.Text.Trim().Equals(this.txtPass.Text.Trim()) == false
                    )
                {
                    ComForm.DspMsg("W103", "");
                    return;
                }
                //验证用户名是否存在
                else
                {
                    BLL.fmd020 bllfmd020 = new BLL.fmd020();
                    bllfmd020.Update_Pass(txtPass.Text.Trim().Replace("'", ""), ComForm.strUserName);
                    ComForm.DspMsg("M002", "");
                }
            }
            catch (Exception ex)
            {
                Comm.InsertErrLog(ex.ToString(), this.Name);
                ComForm.DspMsg("E013", "");
            }
        }
Example #3
0
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            ////Application.Run(new BllTest());
            //Application.Run(new WinLogin());


            try
            {
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionEventHandler);
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Process[] myProcesses = Process.GetProcessesByName(Application.ProductName);
                if (myProcesses.Length <= 1)
                {
                    //Application.Run(new testForm("2015/01/29", "BSC070", "","HL_BSC070_150128_01", "", "", "", ""));

                    Application.Run(new WinLogin());
                }
                else
                {
                    ComForm.DspMsg("E002", "");
                }
                Application.Exit();
            }
            catch (Exception ex)
            {
                ComForm.DspMsg("E001", "");
                ComForm.InsertErrLog(ex.Message, "LOGIN");
            }
        }
Example #4
0
        /// <summary>
        /// 初始化设置
        /// </summary>
        public void SetLoad()
        {
            try
            {
                ShowLRHM();

                DateLab.Text = PublicFun.GetSystemDateTime(ComConst.Date, "yyyy/MM/dd");

                //// 获取社员名字
                //DataTable dt = _menuprobll.GetSymc(Const.SYBH);
                //if (0 < dt.Rows.Count)
                //{
                //    LabSybh.Text = dt.Rows[0][0].ToString();
                //}
                //else
                //{
                //    LabSybh.Text = Const.SYBH;
                //}
                //dt.Clear();

                LabSybh.Text = "您好," + ComForm.strSymc + "( " + Const.SYBH + " )";
                btn01.Focus();
            }
            catch (Exception ex)
            {
                ComForm.DspMsg("E001", "");
                //MessageBox.Show("系统出现问题,请与管理员联系!");
                return;
            }
        }
Example #5
0
        private void fspdMc_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            try
            {
                //权限判断
                string rt      = cboGlMc.SelectedValue.ToString();
                string ty      = rt.Substring(0, 1);
                string arrData = System.Configuration.ConfigurationSettings.AppSettings["QX"];

                if (arrData == "0" && ty == "9")
                {
                    this.txtMcKey.Enabled = false;
                    this.txtZsMc.Enabled  = false;
                    this.txtSxMc.Enabled  = false;
                    return;
                }
                if (this.fspdMc.ActiveSheet.Rows.Count == 0)
                {
                    return;
                }


                txtMcKey.Text = this.fspdMc.Sheets[0].Cells[e.Row, 0].Text.ToString().Trim().Substring(2);
                txtZsMc.Text  = this.fspdMc.Sheets[0].Cells[e.Row, 1].Text.ToString().Trim();
                txtSxMc.Text  = this.fspdMc.Sheets[0].Cells[e.Row, 2].Text.ToString().Trim();
                lblID.Text    = this.fspdMc.Sheets[0].Cells[e.Row, 3].Text.ToString().Trim();
            }
            catch (Exception ex)
            {
                ComForm.InsertErrLog(ex.Message, this.Text);
            }
        }
Example #6
0
        /// <summary>
        /// 显现窗体函数 listView1
        /// </summary>
        private void ListViewSelect(string FromName)
        {
            try
            {
                string strForm  = string.Empty;
                Form   showForm = null;

                // 获取程序名称(英文)
                DataTable dt = _projectbll.GetP_PorName(FromName.Trim());
                if (0 < dt.Rows.Count)
                {
                    string P_PorName = dt.Rows[0]["P_PorName"].ToString();
                    showForm = (Form)System.Reflection.Assembly.Load("TianMaSystem").CreateInstance("TianMaSystem." + P_PorName);
                }
                dt.Clear();

                strForm = showForm.Name;
                Form fr = Application.OpenForms[strForm];
                if (fr != null)
                {
                    fr.BringToFront();
                }
                else
                {
                    showForm.MdiParent     = this;
                    showForm.StartPosition = FormStartPosition.Manual;
                    showForm.Show();
                }
            }
            catch (Exception ex)
            {
                ComForm.DspMsg("W002", "");
                //ComForm.InsertErrLog(ex.ToString(), this.Name.ToString());
            }
        }
Example #7
0
 /// <summary>
 /// 退出系统
 /// </summary>
 public void Closed()
 {
     try
     {
         if ("0" == Function.ComForm.DspMsg("Q001", ""))
         {
             // 删除登录信息
             WinMenuPro fr = (WinMenuPro)Application.OpenForms["WinMenuPro"];
             if (fr != null)
             {
                 fr.Close();
             }
             this.Close();
             Application.Exit();
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
         ComForm.DspMsg("E001", "");
         //MessageBox.Show("系统出现问题,请与管理员联系!");
         return;
     }
 }
Example #8
0
 private void txtDZ_Validating(object sender, CancelEventArgs e)
 {
     try
     {
         //if ("0".Equals(txtDZ.Text) || "00".Equals(txtDZ.Text) || "000".Equals(txtDZ.Text))
         //{
         //    txtDZ.Text = string.Empty;
         //    return;
         //}
         //if (!txtDZ.Text.IsNullOrEmpty())
         //{
         //    txtDZ.Text = txtDZ.Text.PadLeft(6, '0');
         //}
         if (DBHelper.Exists("FMD000", " and "))
         {
             //_modelFMD030 = new Model.fmd030();
             //_modelFMD030 = _bllFMD030.GetModel(txtDZ.Text, "");
             //txtZsMc.Text = _modelFMD030.KHMC;
             //txtSxMc.Text = _modelFMD030.KHSXM;
         }
         else
         {
             txtGYSMC.Text   = "";
             txtGYSSLMC.Text = "";
         }
     }
     catch (Exception ex)
     {
         ComForm.InsertErrLog(ex.Message, this.Text);
     }
 }
Example #9
0
 public void SetListView(string strNO, ListView lv)
 {
     try
     {
         lv.Items.Clear();
         DataTable dt = _projectbll.GetProject_Name(strNO);//, ComForm.strUserName
         if (dt.Rows.Count > 0)
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 //   设置行高   20
                 ImageList imgList = new ImageList();
                 imgList.ImageSize = new Size(20, 20); //分别是宽和高
                 lv.SmallImageList = imgList;          //这里设置listView的SmallImageList ,用imgList将其撑大
                 lv.SmallImageList = imageList1;
                 lv.Items.Add(dt.Rows[i]["Name"].ToString(), 2);
             }
         }
         dt.Clear();
     }
     catch (Exception ex)
     {
         ComForm.DspMsg("E001", "");
         //MessageBox.Show("系统出现问题,请与管理员联系!");
         return;
     }
 }
Example #10
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     if (ComConst.LING == ComForm.DspMsg("Q001", ""))
     {
         System.GC.Collect();
         this.Close();
     }
 }
Example #11
0
 static void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e)
 {
     try
     {
         ComForm.InsertErrLog("ExceptionObject" + e.ExceptionObject + "," + e.ToString(), "ERROR");
     }
     catch
     {
     }
 }
Example #12
0
 private void WinFMD010_Load(object sender, EventArgs e)
 {
     try
     {
         Init();
     }
     catch (Exception ex)
     {
         ComForm.InsertErrLog(ex.Message, this.Text);
     }
 }
Example #13
0
 private void txtUserName1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar >= (char)Keys.D0 && e.KeyChar <= (char)Keys.D9 || e.KeyChar == (char)Keys.Back)
     {
         e.Handled = false;
     }
     else
     {
         e.Handled = true;
     }
     ComForm.IsAlphAndNum(e);
 }
Example #14
0
 //退出按钮
 private void btnClose_Click(object sender, EventArgs e)
 {
     if (ComConst.LING == ComForm.DspMsg("Q001", ""))
     {
         System.GC.Collect();
         this.Close();
     }
     else
     {
         cboGlMc.Focus();
     }
 }
Example #15
0
 //退出按钮
 private void btnClose()
 {
     if (ComConst.LING == ComForm.DspMsg("Q001", ""))
     {
         System.GC.Collect();
         this.Close();
     }
     else
     {
         return;
     }
 }
Example #16
0
 private void Menu1_Button(object sender, EventArgs e)
 {
     try
     {
         GetShowListView(sender);
     }
     catch (Exception ex)
     {
         ComForm.DspMsg("E001", "");
         //MessageBox.Show("系统出现问题,请与管理员联系!");
         return;
     }
 }
Example #17
0
 private void WinFMD010_Load(object sender, EventArgs e)
 {
     try
     {
         //定义Spread 行数
         this.fspdMc.ActiveSheet.Rows.Count = 0;
         //combox绑定数据
         comboxBind(cboGlMc, "GLMC");
     }
     catch (Exception ex)
     {
         ComForm.InsertErrLog(ex.Message, this.Text);
     }
 }
Example #18
0
        private void btn_Login_Click(object sender, EventArgs e)
        {
            //btn_Login.Text = "正在登录...";
            //Application.DoEvents();
            string UserName = Function.ComForm.strUserName = txtUserName.Text.Trim().ToLower().Replace("'", "");

            ComForm.strSymc = UserNameLab.Text.Trim();
            string PassWord = txtPass.Text.Trim().Replace("'", "");

            Function.Const.SYBH = ComForm.strUserName;
            if (UserName == string.Empty)
            {
                ComForm.DspMsg("W001", "");
                this.txtUserName.Focus();
                return;
            }
            if (PassWord == string.Empty)
            {
                ComForm.DspMsg("W005", "");
                this.txtPass.Focus();
                return;
            }
            if (CheckUserPass(UserName, PassWord))
            {
                // 管理员权限登录,打开FirstPage菜单
                WinMenuPro fr = (WinMenuPro)Application.OpenForms["WinMenuPro"];
                if (fr != null)
                {
                    fr.Close();
                    WinMenuPro Main = new WinMenuPro();
                    Main.Show();
                }
                else
                {
                    WinMenuPro Main = new WinMenuPro();
                    Main.Show();
                }
                this.txtUserName.Focus();
                this.Hide();
                //btn_Login.Text = "登  录";
                ClearItems();
            }
            else
            {
                ComForm.DspMsg("W101", "");
                this.txtPass.Focus();
                return;
            }
        }
Example #19
0
 //清空按钮
 private void btnClear_Click(object sender, EventArgs e)
 {
     if (ComConst.LING == ComForm.DspMsg("Q002", ""))
     {
         cboGlMc.Text  = string.Empty;
         txtMcKey.Text = string.Empty;
         txtSxMc.Text  = string.Empty;
         txtZsMc.Text  = string.Empty;
         fspdMc.ActiveSheet.Rows.Count = 0;
         cboGlMc.Focus();
     }
     else
     {
         cboGlMc.Focus();
     }
 }
Example #20
0
 //清空按钮
 private void btnClear_Click(object sender, EventArgs e)
 {
     if (ComConst.LING == ComForm.DspMsg("Q002", ""))
     {
         // cboGlMc.Text = string.Empty;
         txtDZ.Text      = string.Empty;
         txtGYSSLMC.Text = string.Empty;
         txtGYSMC.Text   = string.Empty;
         // fspdMc.ActiveSheet.Rows.Count = 0;
         // cboGlMc.Focus();
         fillSPD();
     }
     else
     {
         //cboGlMc.Focus();
         txtGYSMC.Focus();
     }
 }
Example #21
0
        //删除按钮
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (cboGlMc.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "管理名称");
                cboGlMc.Focus();
                return;
            }

            if (lblID.Text.IsNullOrEmpty())
            {
                ComForm.DspMsg("W063", "");
                cboGlMc.Focus();
                return;
            }

            if (Const.LING == ComForm.DspMsg("Q003", ""))
            {
                try
                {
                    _modelFMD000.ID = lblID.Text.StringToInt();
                    if (DbHelperMySql.ExecuteSql(DBHelper.Del(TableName, " and ID=" + _modelFMD000.ID + "")) != -1)
                    {
                        ComForm.DspMsg("M001", "");
                        lblID.Text = string.Empty;
                    }
                    else
                    {
                        ComForm.DspMsg("E001", "");
                    }
                    cboGlMc.Focus();
                }
                catch (Exception ew)
                {
                    ComForm.DspMsg("E001", "");
                    return;
                }
                txtMcKey.Text = string.Empty;
                txtSxMc.Text  = string.Empty;
                txtZsMc.Text  = string.Empty;
                fillSPD();
            }
        }
Example #22
0
        private void fillSPD()
        {
            try
            {
                //"" = cboGlMc.SelectedValue.ToString();
                //_modelFMD030.KHBH = txtDZ.Text.Trim();
                this.fspdMc.ActiveSheet.Rows.Count = 0;
                string        strWhere   = " and SCQF='0'";
                List <string> listFields = new List <string>();
                listFields.Add(" ID,GYSMC,GYSSLMC,DZ,DH,LXR");
                DataTable dtTable = DbHelperMySql.Query(DBHelper.getAllList(TableName, listFields, strWhere)).Tables[0];

                if (dtTable.Rows.Count > 0)
                {
                    for (int i = 0; i < dtTable.Rows.Count; i++)
                    {
                        this.fspdMc.ActiveSheet.Rows.Count++;
                        //往spread里填充数据
                        this.fspdMc.ActiveSheet.SetValue(i, 0, dtTable.Rows[i]["GYSMC"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 1, dtTable.Rows[i]["GYSSLMC"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 2, dtTable.Rows[i]["DZ"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 3, dtTable.Rows[i]["DH"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 4, dtTable.Rows[i]["LXR"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 5, dtTable.Rows[i]["ID"].ToString());
                    }

                    ComSpread.SpdSetFocus(fspdMc, 0, 0);
                    fspdMc.ActiveSheet.Rows[0].BackColor = Color.Lavender;
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                ComForm.InsertErrLog(ex.Message, this.Text);
            }
        }
Example #23
0
        private void fspdMc_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            try
            {
                //权限判断
                // string rt = cboGlMc.SelectedValue.ToString();
                //string ty = rt.Substring(0, 1);
                //string arrData = System.Configuration.ConfigurationSettings.AppSettings["QX"];


                txtGYSMC.Text   = this.fspdMc.ActiveSheet.Cells[e.Row, 0].Text.ToString().Trim();
                txtGYSSLMC.Text = this.fspdMc.ActiveSheet.Cells[e.Row, 1].Text.ToString().Trim();
                txtDZ.Text      = this.fspdMc.ActiveSheet.Cells[e.Row, 2].Text.ToString().Trim();
                txtDH.Text      = this.fspdMc.ActiveSheet.Cells[e.Row, 3].Text.ToString().Trim();
                txtLXR.Text     = this.fspdMc.ActiveSheet.Cells[e.Row, 4].Text.ToString().Trim();
                iID             = this.fspdMc.ActiveSheet.Cells[e.Row, 5].Text.ToString().StringToInt();
            }
            catch (Exception ex)
            {
                ComForm.InsertErrLog(ex.Message, this.Text);
            }
        }
Example #24
0
        private void fillSPD()
        {
            try
            {
                if (cboGlMc.Text.ToString().IsNullOrEmpty())
                {
                    this.fspdMc.ActiveSheet.Rows.Count = 0;
                    return;
                }
                _modelFMD000.GLBH = cboGlMc.getValue();
                this.fspdMc.ActiveSheet.Rows.Count = 0;
                DataTable dtTable = _bllFMD000.getspread(_modelFMD000);

                if (dtTable.Rows.Count > 0)
                {
                    for (int i = 0; i < dtTable.Rows.Count; i++)
                    {
                        this.fspdMc.ActiveSheet.Rows.Count++;
                        //往spread里填充数据
                        this.fspdMc.ActiveSheet.SetValue(i, 0, dtTable.Rows[i]["glbh"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 1, dtTable.Rows[i]["zsmc"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 2, dtTable.Rows[i]["slmc"].ToString());
                        this.fspdMc.ActiveSheet.SetValue(i, 3, dtTable.Rows[i]["ID"].ToString());
                    }

                    //ComSpread.SpdSetFocus(fspdMc, 0, 0);
                    fspdMc.ActiveSheet.Rows[0].BackColor = Color.Lavender;
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                ComForm.InsertErrLog(ex.Message, this.Text);
            }
        }
Example #25
0
 private void txtMcKey_Validating(object sender, CancelEventArgs e)
 {
     try
     {
         if (txtMcKey.Text.IsNullOrEmpty())
         {
             txtMcKey.Text = string.Empty;
             return;
         }
         if (!txtMcKey.Text.IsNullOrEmpty())
         {
             txtMcKey.Text = txtMcKey.Text.PadLeft(2, '0');
         }
         if (cboGlMc.Text.IsNullOrEmpty())
         {
             return;
         }
     }
     catch (Exception ex)
     {
         ComForm.InsertErrLog(ex.Message, this.Text);
     }
 }
Example #26
0
        private void навантаженняПоЦикловійКомісіїToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var vykform = new ComForm <Planove>(db.Planoves, db);

            vykform.Show();
        }
Example #27
0
        /// <summary>
        /// 显示文档函数:把帮助文档从服务器上下载到本地机器,在打开文档。
        /// </summary>
        private void ListViewSelectWd(string FromName)
        {
            try
            {
                // 服务器路径
                string SourcePath = System.Configuration.ConfigurationSettings.AppSettings["SourcePath"].ToString();

                // 【考勤明细录入】文件名
                string strKaoQin = System.Configuration.ConfigurationSettings.AppSettings["KaoQin"].ToString();

                // 【工资】文件名
                string strGongZi = System.Configuration.ConfigurationSettings.AppSettings["GongZi"].ToString();

                // 【帮助】文件名
                string strHelp = System.Configuration.ConfigurationSettings.AppSettings["Help"].ToString();

                switch (FromName)
                {
                case "考勤入力用例":
                    SourcePath = SourcePath + "\\" + strKaoQin;
                    // 打开服务器文件
                    System.Diagnostics.Process.Start(SourcePath);
                    break;

                case "工资计算用例":
                    SourcePath = SourcePath + "\\" + strGongZi;
                    // 打开服务器文件
                    System.Diagnostics.Process.Start(SourcePath);
                    break;

                case "使用说明书":
                    SourcePath = SourcePath + "\\" + strHelp;
                    // 目标路径
                    string TargetPath = System.Configuration.ConfigurationSettings.AppSettings["TargetPath"].ToString();

                    // 帮助文档是否覆盖,true覆盖,false不覆盖
                    bool Isrewrite = true;

                    if (!System.IO.File.Exists(TargetPath + strHelp))
                    {
                        if (!System.IO.Directory.Exists(TargetPath))
                        {
                            System.IO.Directory.CreateDirectory(TargetPath);
                        }

                        // 获取服务器文档的扩展名(Extension)如:.txt - .xls - .pdf等等
                        string strExten = Path.GetExtension(SourcePath);

                        // 从服务器拷贝到本地
                        System.IO.File.Copy(SourcePath, TargetPath + strHelp, Isrewrite);

                        //// 打开本地文件
                        System.Diagnostics.Process.Start(TargetPath + strHelp);
                    }
                    else
                    {
                        //// 打开本地文件
                        System.Diagnostics.Process.Start(TargetPath + strHelp);
                    }

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                ComForm.DspMsg("W002", "");
                //ComForm.InsertErrLog(ex.ToString(), this.Name.ToString());
            }
        }
Example #28
0
 private void txtDZ_KeyPress(object sender, KeyPressEventArgs e)
 {
     ComForm.IsNum(e);
 }
Example #29
0
        //删除按钮
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //if (cboGlMc.Text.strReplace().IsNullOrEmpty())
            //{
            //    ComForm.DspMsg("W002", "管理名称");
            //    cboGlMc.Focus();
            //    return;
            //}
            if (txtDZ.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "客户编号");
                txtDZ.Focus();
                return;
            }

            //判断名称KEY 是否存在
            bool chkMckey = false;

            for (int i = 0; i < fspdMc.ActiveSheet.Rows.Count; i++)
            {
                if (txtDZ.Text.Equals(ComSpread.SpdGetValue(fspdMc, i, 0)))
                {
                    chkMckey = true;
                    break;
                }
            }
            //判断名称KEY 是否存在,不存在不做删除操作
            //if (chkMckey == false)
            //{
            //    ComForm.DspMsg("W063", "客户编号");

            //    txtDZ.Focus();
            //    return;
            //}


            //chkMckey = false;
            //for (int i = 0; i < fspdMc.ActiveSheet.Rows.Count; i++)
            //{
            //    if (txtZsMc.Text.Equals(ComSpread.SpdGetValue(fspdMc, i, 1)))
            //    {
            //        chkMckey = true;
            //        break;
            //    }
            //}
            //判断名称KEY 是否存在,不存在不做删除操作
            if (chkMckey == false)
            {
                ComForm.DspMsg("W063", "客户名称");

                txtGYSMC.Focus();
                return;
            }

            if (Const.LING == ComForm.DspMsg("Q003", ""))
            {
                try
                {
                    //_modelFMD030.KHBH = txtDZ.Text.strReplace();
                    //_modelFMD030.KHMC = txtZsMc.Text.strReplace();
                    //_bllFMD030.Delete(_modelFMD030.KHBH, "");
                    ComForm.DspMsg("M001", "");
                    txtDZ.Focus();
                }
                catch (Exception ew)
                {
                    ComForm.DspMsg("E001", "");
                    return;
                }
                txtDZ.Text      = string.Empty;
                txtGYSSLMC.Text = string.Empty;
                txtGYSMC.Text   = string.Empty;
                fillSPD();
            }
        }
Example #30
0
        //保存按钮
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtGYSMC.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "供应商名称");
                txtGYSMC.Focus();
                return;
            }

            if (DBHelper.Exists(TableName, "and GYSMC='" + txtGYSMC.Text.strReplace() + "'"))
            {
                ComForm.DspMsg("W068", "供应商名称");
                txtGYSMC.Focus();
                return;
            }
            if (ComConst.LING == ComForm.DspMsg("Q004", ""))
            {
                try
                {
                    Model.fmd030 _modelFMD030 = new Model.fmd030();
                    _modelFMD030.ID      = iID;
                    _modelFMD030.GYSMC   = txtGYSMC.Text.strReplace();
                    _modelFMD030.GYSSLMC = txtGYSSLMC.Text.strReplace();
                    _modelFMD030.DZ      = txtDZ.Text.strReplace();
                    _modelFMD030.DH      = txtDH.Text.strReplace();
                    _modelFMD030.LXR     = txtLXR.Text.strReplace();
                    if (_modelFMD030.ID != -1)
                    {
                        //更新数据
                        _modelFMD030.GXZBH = ComForm.strUserName;
                        _modelFMD030.GXR   = PublicFun.GetSystemDateTime(Const.Date, Const.dateStyle_YMD);
                        _modelFMD030.GXSJ  = PublicFun.GetSystemDateTime(Const.Time, string.Empty);
                        _modelFMD030.GXDMM = systemdate.Get_SysDNBH();
                        DbHelperMySql.ExecuteSql(DBHelper.Update(TableName, _modelFMD030, " and ID=" + _modelFMD030.ID + ""));

                        //_bllFMD030.Update(_modelFMD030);
                        ComForm.DspMsg("M002", "");
                        txtGYSMC.Focus();
                    }
                    else
                    {
                        //插入数据
                        _modelFMD030.ID    = null;
                        _modelFMD030.RLZBH = ComForm.strUserName;
                        _modelFMD030.RLR   = PublicFun.GetSystemDateTime(Const.Date, Const.dateStyle_YMD);
                        _modelFMD030.RLSJ  = PublicFun.GetSystemDateTime(Const.Time, string.Empty);
                        _modelFMD030.RLDMM = systemdate.Get_SysDNBH();
                        DbHelperMySql.ExecuteSql(DBHelper.Add(TableName, _modelFMD030));
                        ComForm.DspMsg("M002", "");
                        txtGYSMC.Focus();
                    }
                }
                catch (Exception ew)
                {
                    ComForm.DspMsg("E001", "");
                    ComForm.InsertErrLog(ew.ToString(), this.Name);
                    return;
                }
                Init();
            }
        }