Example #1
0
        public FeedbackInfomation QueryStocktakingBillDetailsInfo(long stocktakingId)
        {
            FeedbackInfomation fi = new FeedbackInfomation();

            try
            {
                DataSet ds = MySMDAL.SelectStocktakingDetails(stocktakingId);
                if (DataValidate.CheckDataSetNotEmpty(ds))
                {
                    fi.Result          = ds;
                    fi.FeedbackMessage = "";
                    fi.ErrorStatus     = STATUS_ADAPTER.QUERY_NORMAL;
                }
                else
                {
                    fi.Result          = null;
                    fi.FeedbackMessage = Tips.QERUY_RESULT_EMPTY;
                    fi.ErrorStatus     = STATUS_ADAPTER.QUERY_NODATA;
                }
                return(fi);
            }
            catch (Exception ex)
            {
                fi.Result          = null;
                fi.FeedbackMessage = Tips.QUERY_FAILED + ":" + ex.Message.ToString();
                fi.ErrorStatus     = STATUS_ADAPTER.QUERY_ERROR;
                return(fi);
            }
        }
Example #2
0
        public string UserLogin(string MyUserName, string MyUserPwd)
        {
            DataRow MyDataRow = DbHelperSQL.GetDataRow("select * from admininfo where aUserName='******'");

            if (MyDataRow == null)
            {
                return("user");
            }
            if (MyUserPwd == DataValidate.ValidateDataRow_S(MyDataRow, "aPwd"))
            {
                HttpContext.Current.Session["names"]    = DataValidate.ValidateDataRow_S(MyDataRow, "aName");
                HttpContext.Current.Session["nums"]     = DataValidate.ValidateDataRow_S(MyDataRow, "aNum");
                HttpContext.Current.Session["username"] = DataValidate.ValidateDataRow_S(MyDataRow, "aUserName");
                HttpContext.Current.Session["userjiao"] = DataValidate.ValidateDataRow_S(MyDataRow, "aRnum");
                HttpContext.Current.Session["shopnum"]  = DataValidate.ValidateDataRow_S(MyDataRow, "aSnum");
                string    sqlf = "select sName from shops where sNum = '" + DataValidate.ValidateDataRow_S(MyDataRow, "aSnum") + "'";
                DataTable dt   = this.bc.ReadTable(sqlf);
                if (dt.Rows.Count > 0)
                {
                    HttpContext.Current.Session["shopname"] = dt.Rows[0]["sName"].ToString();
                }
                return("true");
            }
            return("pwd");
        }
Example #3
0
        private StocktakingBillDetail DrToStocktakingBillDetail(DataRow dr)
        {
            StocktakingBillDetail sbd = new StocktakingBillDetail();

            sbd.StocktakingDetailID = Convert.ToInt64(dr["StocktakingDetailID"]);
            sbd.StocktakingID       = Convert.ToInt64(dr["StocktakingID"]);
            sbd.CompanyID           = Convert.ToInt32(dr["CompanyID"]);
            sbd.CompanyName         = dr["CompanyName"].ToString();
            sbd.DepotName           = dr["DepotName"].ToString();
            sbd.ReservoirName       = dr["ReservoirName"].ToString();
            sbd.GalID            = Convert.ToInt32(dr["GalID"]);
            sbd.GalName          = dr["GalName"]?.ToString();
            sbd.GalDescript      = dr["GalDescript"]?.ToString();
            sbd.SkuID            = Convert.ToInt32(dr["SkuID"]);
            sbd.ProductName      = dr["ProductName"]?.ToString();
            sbd.GoodsName        = dr["GoodsName"]?.ToString();
            sbd.Spec             = dr["Spec"]?.ToString();
            sbd.Grade            = dr["Grade"]?.ToString();
            sbd.Manufacturer     = dr["Manufacturer"]?.ToString();
            sbd.Packaging        = dr["Packaging"]?.ToString();
            sbd.SignType         = dr["SignType"]?.ToString();
            sbd.SignNum          = dr["SignNum"]?.ToString();
            sbd.Spare            = dr["Spare"]?.ToString();
            sbd.PN               = Convert.ToInt32(dr["PN"]);
            sbd.AN               = Convert.ToDecimal(dr["AN"]);
            sbd.Status           = Convert.ToInt32(dr["Status"]);
            sbd.StatusName       = dr["StatusName"].ToString();
            sbd.ResultStatus     = DataValidate.GetValueOrNullInt(dr["ResultStatus"]);
            sbd.ResultStatusName = dr["ResultStatusName"]?.ToString();
            sbd.Checker          = DataValidate.GetValueOrNullInt(dr["Checker"]);
            sbd.CheckName        = dr["CheckName"]?.ToString();
            sbd.CheckTime        = DataValidate.GetValueOrNullDateTime(dr["CheckTime"]);
            sbd.Remark           = dr["Remark"]?.ToString();
            return(sbd);
        }
Example #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            dt_user user = new dt_user()
            {
                Name = textBox2.Text,           // 1~6个字
                Age  = int.Parse(textBox1.Text) // 0~150
            };


            //if(string.IsNullOrEmpty(user.Name)) {
            //    MessageBox.Show("Name不能为空");
            //    return;
            //}

            IMessage msg = DataValidate.Validate(user);

            if (msg.State == 0)
            {
                MessageBox.Show(msg.Msg);
                return;
            }
            else
            {
                MessageBox.Show("成功");
                return;
            }
        }
Example #5
0
 //判断图书条码为数值
 private void txtBarCode_TextChanged(object sender, EventArgs e)
 {
     if (!DataValidate.IsInteger(this.txtBarCode.Text.Trim()))
     {
         this.txtBarCode.Text = "";
     }
 }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //选中匿名登录,直接匿名身份登录,否则,判断用户名和密码是否正确
            if (this.checkBox1.Checked == false)
            {
                #region 数据验证
                if (this.txtLoginId.Text.Trim().Length == 0)
                {
                    MessageBox.Show("请填写用户名!", "登录提示");
                    this.txtLoginId.Focus();
                    return;
                }
                if (!DataValidate.IsInteger(this.txtLoginId.Text.Trim()))
                {
                    MessageBox.Show("用户名必须为正整数!", "登录提示");
                    this.txtLoginId.Focus();
                    return;
                }
                if (this.txtLoginPwd.Text.Trim().Length == 0)
                {
                    MessageBox.Show("请填写密码!", "登录提示");
                    this.txtLoginPwd.Focus();
                    return;
                }
                #endregion

                //封装对象
                SysAdmin objAdmin = new SysAdmin()
                {
                    LoginId  = Convert.ToInt32(this.txtLoginId.Text.Trim()),
                    LoginPwd = this.txtLoginPwd.Text.Trim()
                };

                try
                {
                    //调用登陆数据库方法,进行账号验证
                    objAdmin = objAdminService.AdminLogin(objAdmin);

                    if (objAdmin == null)
                    {
                        MessageBox.Show("用户名或密码不正确!", "登录提示");
                        return;
                    }
                    else
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("登陆异常,原因:" + ex.Message, "登录提示");
                    return;
                }
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }
Example #7
0
        private void btnTestConnect_Click(object sender, EventArgs e)
        {
            string             dbip   = this.txtDBIp.Text;
            string             dbport = this.txtDBPort.Text;
            string             dbname = this.txtDBName.Text;
            string             dbsa   = this.txtDBSa.Text;
            string             dbpwd  = this.txtDBPwd.Text;
            FeedbackInfomation fi     = new FeedbackInfomation();

            fi = DataValidate.ValidateIpAddress(dbip);
            if (fi.ErrorStatus != STATUS_ADAPTER.IP_NORMAL)
            {
                MsgBox.ShowDialog(Tips.DB + fi.FeedbackMessage);
                return;
            }
            DBTestBLL dtbll = new DBTestBLL();

            fi = dtbll.TestDBConnect(dbip, dbport, dbname, dbsa, dbpwd);
            if (fi.ErrorStatus == STATUS_ADAPTER.DB_CONNECT_NORMAL)
            {
                this.labDBStatus.Text = "状态:" + this.STATUS_DBTEST_CONNECTED;
                SetDbStatus();
                //MsgBox.ShowDialog(Tips.DB_CONNECTTEST_SUCCESS);
            }
            else
            {
                this.labDBStatus.Text = this.STATUS_DBTEST_NOCONNECTED;
                MsgBox.ShowDialog(Tips.DB_CONNECTTEST_FAILED);
            }
        }
Example #8
0
 /// <summary>
 /// 填写烟罩长度时脖颈距离中心距离自动改变
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtLength_TextChanged(object sender, EventArgs e)
 {
     if (!DataValidate.IsDecimal(txtLength.Text.Trim()) || txtLength.Text.Trim().Length == 0)
     {
         return;
     }
     txtExRightDis.Text = (Convert.ToDecimal(txtLength.Text.Trim()) / 2).ToString();
 }
Example #9
0
 //SQL成绩失焦事件
 private void textSQL_LostFocus(object sender, RoutedEventArgs e)
 {
     if (DataValidate.IsInteger(textSQL.Text.Trim()) == false)
     {
         System.Windows.Forms.MessageBox.Show("请输入正确分数!!!", "友情提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
         return;
     }
 }
Example #10
0
        //登录
        private void btnLoin_Click(object sender, RoutedEventArgs e)
        {
            //数据验证
            if (txtLogID.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入登录账号!", "登录提示");
                txtLogID.Focus(); //获取焦点
                return;
            }
            if (DataValidate.IsInteger(txtLogID.Text.Trim()) == false) //Datavalidate存在common问文件下,通过正则表达式判断输入的账号是否为数字
            {
                MessageBox.Show("请输入正确账号!(纯数字格式)", "登录提示");
                txtLogID.Focus();
                return;
            }
            if (txtLogPwd.Password.Length == 0)
            {
                MessageBox.Show("请输入登录密码!", "登录提示");
                txtLogPwd.Focus();
                return;
            }
            //输入的账号密码
            Admins admin = new Admins()
            {
                LoginID  = Convert.ToInt32(txtLogID.Text.Trim()), //获取到输入的账号
                LoginPwd = txtLogPwd.Password.Trim()              //输入的密码
            };

            //和后台交互查询,判断登录信息是否正确
            try
            {
                Admins mainuse = new AdminManager().GetAdmins(admin); //通过管理员账号获取到密码
                if (mainuse == null)
                {
                    MessageBox.Show("用户账号不存在!", "提示信息");
                    txtLogID.Focus(); //获取焦点
                }
                else
                {
                    if (mainuse.LoginPwd == txtLogPwd.Password)
                    {
                        //保存登录信息
                        App.CurrentAdmin  = mainuse;
                        this.DialogResult = true;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("用户密码错误!", "提示信息");
                        txtLogPwd.Focus();
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("服务器连接异常,登录失败!请检查您的网络!");
            }
        }
Example #11
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            //数据验证
            if (txtLogId.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入登录账号!", "登录提示");
                txtLogId.Focus();//焦点
                return;
            }
            if (DataValidate.IsInteger(txtLogId.Text.Trim()) == false)//通过通用层进行验证
            {
                MessageBox.Show("账号有误!(纯数字格式)", "登录提示");
                txtLogId.Focus();//聚焦
                return;
            }
            if (txtLogPwd.Password.Length == 0)
            {
                MessageBox.Show("请输入登录密码!", "登录提示");
                txtLogPwd.Focus();
                return;
            }
            //输入的账号密码
            Admins admins = new Admins()
            {
                LoginId = Convert.ToInt32(txtLogId.Text.Trim())
            };

            //先尝试和后天交互,进行查询是否有对应项
            try
            {
                Admins mainuse = new AdminManager().GetAdmins(admins);
                if (mainuse == null)
                {
                    MessageBox.Show("用户信息不存在重新输入!", "提示信息");
                    txtLogId.Focus();//聚焦
                }
                else
                {
                    if (mainuse.LoginPwd == Convert.ToInt32(txtLogPwd.Password))
                    {
                        //保存登录信息
                        App.CurrentAdmin  = mainuse;
                        this.DialogResult = true;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("用户密码有误请重新输入!", "提示信息");
                        txtLogPwd.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("服务器连接异常,登录失败!请检查您的网络!");
                throw ex;
            }
        }
Example #12
0
        private void btnEditData_Click(object sender, EventArgs e)
        {
            #region 数据验证
            //必填项目
            if (pbModelImage.Tag.ToString().Length == 0)
            {
                return;
            }
            if (!DataValidate.IsDecimal(txtLength.Text.Trim()) || Convert.ToDecimal(txtLength.Text.Trim()) < 100m)
            {
                MessageBox.Show("请认真检查灯腔长度", "提示信息");
                txtLength.Focus();
                txtLength.SelectAll();
                return;
            }

            //其他配置
            if (cobLightType.SelectedIndex == -1)
            {
                MessageBox.Show("请选择灯具类型", "提示信息");
                cobLightType.Focus();
                return;
            }
            if (cobJapan.SelectedIndex == -1)
            {
                MessageBox.Show("请选择是否为日本项目", "提示信息");
                cobJapan.Focus();
                return;
            }


            #endregion
            //封装对象
            LKA258 objLKA258 = new LKA258()
            {
                LKA258Id = Convert.ToInt32(pbModelImage.Tag),

                LightType = cobLightType.Text,
                Japan     = cobJapan.Text,
                Length    = Convert.ToDecimal(txtLength.Text.Trim())
            };
            //提交修改
            try
            {
                if (objLKA258Service.EditModel(objLKA258) == 1)
                {
                    MessageBox.Show("制图数据修改成功", "提示信息");
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #13
0
        public bool CheckedOperatorAccountRepeate(string account, int operatorId)
        {
            DataSet ds = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), "Operator_View_Check", account, operatorId);

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                return(true);
            }
            return(false);
        }
Example #14
0
        bool CheckInfor()
        {
            if (string.IsNullOrEmpty(txtName.Text))
            {
                System.Windows.MessageBox.Show("姓名不能为空!");
                txtName.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtAge.Text))
            {
                System.Windows.MessageBox.Show("年龄不能为空!");
                txtAge.Focus();
                return(false);
            }
            else if (!DataValidate.IsInteger(txtAge.Text))
            {
                System.Windows.MessageBox.Show("年龄必须是纯数字!");
                txtAge.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtCardNo.Text))
            {
                System.Windows.MessageBox.Show("打卡号不能为空!");
                txtCardNo.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(txtStuNoId.Text))
            {
                System.Windows.MessageBox.Show("身份证号不能为空!");
                txtStuNoId.Focus();
                return(false);
            }

            //if (Common.DataValidate.IsIdentitycard(txtStuNoId.Text))
            //{
            //    System.Windows.MessageBox.Show("必须为18位正整数!");
            //    txtStuNoId.Focus();
            //    return false;
            //}
            if (string.IsNullOrEmpty(txtPhoneNumber.Text))
            {
                System.Windows.MessageBox.Show("联系方式不能为空!");
                txtPhoneNumber.Focus();
                return(false);
            }

            if (Common.DataValidate.IsPhone(txtPhoneNumber.Text))
            {
                System.Windows.MessageBox.Show("必须为11位数!");
                txtStuNoId.Focus();
                return(false);
            }
            return(true);
        }
Example #15
0
        /// <summary>
        /// 更新图书数量
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (this.txtAddCount.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入新增图书总数", "新增提示");
                this.txtAddCount.SelectAll();
                this.txtAddCount.Focus();
                return;
            }

            if (!DataValidate.IsInteger(this.txtAddCount.Text.Trim()))
            {
                MessageBox.Show("新增图书总数必须是正整数!", "新增提示");
                this.txtAddCount.SelectAll();
                this.txtAddCount.Focus();
                return;
            }


            try
            {
                var result = bookManager.UpdateBookCount(this.txtBarCode.Text.Trim(), Convert.ToInt32(this.txtAddCount.Text.Trim()));
                if (result == 1)
                {
                    var book = books.Where(o => o.BarCode == this.txtBarCode.Text.Trim()).First();
                    book.BookCount += Convert.ToInt32(this.txtAddCount.Text.Trim());
                    this.dgvBookList.Refresh();

                    MessageBox.Show("新增成功,是否需要继续更新该图书数量?", "新增提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                    //if (dialogResult == DialogResult.OK)
                    //{
                    //    this.txtAddCount.Text = string.Empty;
                    //    this.txtAddCount.Focus();
                    //    return;
                    //}
                    //清除其他信息:
                    this.lblBookName.Text     = string.Empty;
                    this.lblCategory.Text     = string.Empty;
                    this.lblBookPosition.Text = string.Empty;
                    this.lblBookId.Text       = string.Empty;
                    this.lblBookCount.Text    = string.Empty;
                    this.pbImage.Image        = null;
                    this.txtAddCount.Text     = string.Empty;
                    this.txtAddCount.Enabled  = false;
                    this.btnSave.Enabled      = false;
                    this.txtBarCode.Clear();
                    this.txtBarCode.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("更新图书数量异常:" + ex.Message, "异常提示");
            }
        }
Example #16
0
        public StockModel SelectStocktakingBill(int cmstId, long Id, SqlTransaction st)
        {
            string  sqlstr = $" select * from StocktakingView where StackingBillID = {Id} and CmstID = {cmstId} ";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(st, CommandType.Text, sqlstr);

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                return(DrToStocktakingBill(ds.Tables[0].Rows[0]));
            }
            return(null);
        }
Example #17
0
        private void btnEditData_Click(object sender, EventArgs e)
        {
            #region 数据验证
            //必填项目
            if (pbModelImage.Tag.ToString().Length == 0)
            {
                return;
            }
            if (!DataValidate.IsDecimal(txtLength.Text.Trim()) || Convert.ToDecimal(txtLength.Text.Trim()) < 200m)
            {
                MessageBox.Show("请认真检查散流器长度", "提示信息");
                txtLength.Focus();
                txtLength.SelectAll();
                return;
            }

            if (cobSuNo.SelectedIndex == -1)
            {
                MessageBox.Show("请选择均流桶数量", "提示信息");
                cobSuNo.Focus();
                return;
            }
            else if (cobSuNo.SelectedIndex > 0 && (!DataValidate.IsDecimal(txtSuDis.Text.Trim()) || Convert.ToDecimal(txtSuDis.Text.Trim()) < 250m))
            {
                MessageBox.Show("请认真检查均流桶间距", "提示信息");
                txtSuDis.Focus();
                txtSuDis.SelectAll();
                return;
            }

            #endregion
            //封装对象
            LSDOST objLSDOST = new LSDOST()
            {
                LSDOSTId = Convert.ToInt32(pbModelImage.Tag),
                SuNo     = Convert.ToInt32(cobSuNo.Text),
                Length   = Convert.ToDecimal(txtLength.Text.Trim()),
                SuDis    = Convert.ToDecimal(txtSuDis.Text.Trim())
            };
            //提交修改
            try
            {
                if (objLSDOSTService.EditModel(objLSDOST) == 1)
                {
                    MessageBox.Show("制图数据修改成功", "提示信息");
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #18
0
 private bool CheckCmstName(string cmstName)
 {
     if (DataValidate.CheckDataSetNotEmpty(MyOrganizationDAL.SelectOrganizationByCmstName(cmstName)))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #19
0
 private bool CheckCmstID(int cmstId)
 {
     if (DataValidate.CheckDataSetNotEmpty(MyOrganizationDAL.SelectOrganizationByCmstId(cmstId)))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #20
0
        public DataSet SelectAllMenu()
        {
            string  sqlstr = "select * from dbo.Menu";
            DataSet ds     = SqlDataHelper.ExecuteDataSet(SqlDataHelper.GetConnection(), CommandType.Text, sqlstr);

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                return(ds);
            }
            return(null);
        }
Example #21
0
        private void btnEditData_Click(object sender, EventArgs e)
        {
            //必填项目
            if (pbModelImage.Tag.ToString().Length == 0)
            {
                return;
            }
            if (!DataValidate.IsDecimal(txtLength.Text.Trim()) || Convert.ToDecimal(txtLength.Text.Trim()) < 50m)
            {
                MessageBox.Show("请认真检查LP板长度", "提示信息");
                txtLength.Focus();
                txtLength.SelectAll();
                return;
            }
            if (!DataValidate.IsDecimal(txtWidth.Text.Trim()) || Convert.ToDecimal(txtWidth.Text.Trim()) < 20m)
            {
                MessageBox.Show("请认真检查W板宽度", "提示信息");
                txtWidth.Focus();
                txtWidth.SelectAll();
                return;
            }
            if (cobZPanelNo.SelectedIndex == -1)
            {
                MessageBox.Show("请选择Z板阵列数量", "提示信息");
                cobZPanelNo.Focus();
                return;
            }

            //封装对象
            LPZ objLPZ = new LPZ()
            {
                LPZId = Convert.ToInt32(pbModelImage.Tag),

                Length   = Convert.ToDecimal(txtLength.Text.Trim()),
                Width    = Convert.ToDecimal(txtWidth.Text.Trim()),
                ZPanelNo = Convert.ToInt32(cobZPanelNo.Text.Trim())
            };

            //提交修改
            try
            {
                if (objLPZService.EditModel(objLPZ) == 1)
                {
                    MessageBox.Show("制图数据修改成功", "提示信息");
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #22
0
        /// <summary>
        /// 判断输入的信息是否合理
        /// </summary>
        /// <returns></returns>
        bool CheckInfor()
        {
            if (string.IsNullOrEmpty(textName.Text))
            {
                System.Windows.MessageBox.Show("姓名不能为空!");
                textName.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(textGardNo.Text))
            {
                System.Windows.MessageBox.Show("打卡号不能为空!");
                textGardNo.Focus();
                return(false);
            }

            /*else if (DataValidate.IsInteger(textGardNo.Text.Trim()))
             * {
             *  System.Windows.MessageBox.Show("打卡号必须为纯数字!");
             *  textGardNo.Focus();
             *  return false;
             * }*/
            if (string.IsNullOrEmpty(textstuNub.Text))
            {
                System.Windows.MessageBox.Show("身份证号不能为空!");
                textstuNub.Focus();
                return(false);
            }
            else if (DataValidate.IsIDcard(textstuNub.Text.Trim()))
            {
                System.Windows.MessageBox.Show("请输入正确身份证格式!");
                textstuNub.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(textstuPhon.Text))
            {
                System.Windows.MessageBox.Show("手机号不能为空!");
                textstuPhon.Focus();
                return(false);
            }
            else if (DataValidate.IsPhonenum(textstuPhon.Text.Trim()))
            {
                System.Windows.MessageBox.Show("请输入正确的手机号格式!");
                textstuPhon.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(textstuAddress.Text))
            {
                System.Windows.MessageBox.Show("地址不能为空!");
                textstuAddress.Focus();
                return(false);
            }
            return(true);
        }
Example #23
0
 private void txtAge_LostFocus(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(txtAge.Text))
     {
         System.Windows.MessageBox.Show("年龄不能为空!");
         txtAge.Focus();
     }
     else if (!DataValidate.IsInteger(txtAge.Text))
     {
         System.Windows.MessageBox.Show("年龄必须是纯数字!");
         txtAge.Focus();
     }
 }
Example #24
0
 //考勤号失去焦点事件
 private void textClockNo_LostFocus(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(textClockNo.Text))
     {
         System.Windows.MessageBox.Show("打卡号不能为空!");
         textClockNo.Focus();
     }
     else if (DataValidate.IsInteger(textClockNo.Text.Trim()) == false)
     {
         System.Windows.Forms.MessageBox.Show("考勤号必须为纯数字!", "友情提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
         return;
     }
 }
Example #25
0
 //手机号失去焦点事件
 private void textstuPhon_LostFocus(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(textstuPhon.Text))
     {
         System.Windows.MessageBox.Show("手机号不能为空!");
         textstuPhon.Focus();
     }
     else if (DataValidate.IsPhonenum(textstuPhon.Text.Trim()))
     {
         System.Windows.MessageBox.Show("请输入正确的手机号格式!");
         textstuPhon.Focus();
     }
 }
Example #26
0
        private void btnEditData_Click(object sender, EventArgs e)
        {
            //必填项目
            if (pbModelImage.Tag.ToString().Length == 0)
            {
                return;
            }
            if (!DataValidate.IsDecimal(txtLength.Text.Trim()) || Convert.ToDecimal(txtLength.Text.Trim()) < 200m)
            {
                MessageBox.Show("请认真检查灯腔侧板总长", "提示信息");
                txtLength.Focus();
                txtLength.SelectAll();
                return;
            }
            if (cobLongGlassNo.SelectedIndex == -1)
            {
                MessageBox.Show("请选择长玻璃数量", "提示信息");
                cobLongGlassNo.Focus();
                return;
            }
            if (cobShortGlassNo.SelectedIndex == -1)
            {
                MessageBox.Show("请选择短玻璃数量", "提示信息");
                cobShortGlassNo.Focus();
                return;
            }
            //封装对象
            LLKA objLLKA = new LLKA()
            {
                LLKAId = Convert.ToInt32(pbModelImage.Tag),

                Length       = Convert.ToDecimal(txtLength.Text.Trim()),
                LongGlassNo  = Convert.ToInt32(cobLongGlassNo.Text.Trim()),
                ShortGlassNo = Convert.ToInt32(cobShortGlassNo.Text.Trim())
            };

            //提交修改
            try
            {
                if (objLLKAService.EditModel(objLLKA) == 1)
                {
                    MessageBox.Show("制图数据修改成功", "提示信息");
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #27
0
        private bool SaveToFile(ProjectInfo projectInfo)
        {
            long projectSaveSize = this.GetProjectSaveSize(projectInfo.projectLossPath);

            if (!DataValidate.IsDiskSpaceEnough(projectInfo.projectLossPath, projectSaveSize))
            {
                this.LastErrMsg = "Save project failed, there is not enough space of disk!";
                return(false);
            }
            this.m_Result = true;
            new Thread(new ParameterizedThreadStart(this.SaveProject)).Start(projectInfo);
            this.m_SavingForm.ShowDialog();
            return(this.m_Result);
        }
Example #28
0
        public DepotsPropertyEntity DsToDepotsPropertyEntity(DataSet ds)
        {
            DepotsPropertyEntity de = new DepotsPropertyEntity();

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                var dr = ds.Tables[0].Rows[0];
                de.DprId     = Convert.ToInt32(dr["Dpr_Id"]);
                de.DprName   = dr["Dpr_Name"].ToString();
                de.DprRemark = dr["Dpr_Remark"].ToString();
                de.DprIfUse  = Convert.ToBoolean(Convert.IsDBNull(dr["Dpr_IfUse"]) == true ? false : dr["Dpr_IfUse"]);
                de.DprIfUse2 = Convert.ToBoolean(dr["Dpr_IfUse"]) == true ? "是" : "否";
            }
            return(de);
        }
Example #29
0
        public RateTypeEntity DsToRateTypeEntity(DataSet ds)
        {
            RateTypeEntity rte = new RateTypeEntity();

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                var dr = ds.Tables[0].Rows[0];
                rte.RtyId     = Convert.ToInt32(dr["Rty_Id"]);
                rte.RtyName   = dr["Rty_Name"].ToString();
                rte.RtyRemark = dr["Rty_Remark"].ToString();
                rte.RtyIfUse  = Convert.ToBoolean(Convert.IsDBNull(dr["Rty_IfUse"]) == true ? false : dr["Rty_IfUse"]);
                rte.RtyIfUse2 = Convert.ToBoolean(dr["Rty_IfUse"]) == true ? "是" : "否";
            }
            return(rte);
        }
Example #30
0
        public MeasureWayEntity DsToMeasureWayEntity(DataSet ds)
        {
            MeasureWayEntity me = new MeasureWayEntity();

            if (DataValidate.CheckDataSetNotEmpty(ds))
            {
                var dr = ds.Tables[0].Rows[0];
                me.MwaId     = Convert.ToInt32(dr["Mwa_Id"]);
                me.MwaName   = dr["Mwa_Name"].ToString();
                me.MwaRemark = dr["Mwa_Remark"].ToString();
                me.MwaIfUse  = Convert.ToBoolean(Convert.IsDBNull(dr["Mwa_IfUse"]) == true ? false : dr["Mwa_IfUse"]);
                me.MwaIfUse2 = Convert.ToBoolean(dr["Mwa_IfUse"]) == true ? "是" : "否";
            }
            return(me);
        }