Beispiel #1
0
        public override int Query()
        {
            if (_FormThe == null)
            {
                _FormThe = new UIForms.FormTheproblemsheetCodition();
                _FormThe.StartPosition = FormStartPosition.CenterParent;
                _FormThe.ShowInTaskbar = false;
            }
            if (_FormThe.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return(0);
            }
            _where = _FormThe.GetWhereCondition;
            List <FishEntity.TheproblemsheetEntityVo> list = _TheBll.GetModelListVo(_where + _rolewhere + _orderBy);

            if (list == null || list.Count < 1)
            {
                _fish = null;
                return(1);
            }
            else
            {
                _fish = list[0];
                SetTheproblemsheet();
                panel1.Enabled = true;
                return(1);
            }
        }
Beispiel #2
0
 private void FormTheproblemsheet_Load(object sender, EventArgs e)
 {
     MenuCode = "M309"; ControlButtomRoles();
     if (Megres.oddNum != null && Megres.oddNum != "")
     {
         _rolewhere = " and code='" + Megres.oddNum + "'";
         List <FishEntity.TheproblemsheetEntityVo> list = _TheBll.GetModelListVo(_rolewhere);
         getname       = Megres.oddNum;
         Megres.oddNum = string.Empty;
         if (list == null || list.Count < 1)
         {
             _fish = null;
         }
         else
         {
             _fish = list[0];
             SetTheproblemsheet();
             this.panel1.Enabled = true;
             menuStrip1.Visible  = true;
             tmiQuery.Visible    = true;
             tmiPrevious.Visible = false;
             tmiExport.Visible   = false;
             tmiReview.Visible   = true;
             tmiAdd.Visible      = false;
             tmiModify.Visible   = true;
             tmiDelete.Visible   = false;
             tmiClose.Visible    = true;
             tmiCancel.Visible   = false;
             tmiSave.Visible     = false;
             tmiNext.Visible     = false;
             tmiprint.Visible    = false;
         }
     }
 }
Beispiel #3
0
        public bool Update(FishEntity.TheproblemsheetEntity model, string name)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update t_theproblemsheet set ");
            strSql.Append(" ContractNo = @ContractNo,");
            strSql.Append(" occurDate = @occurDate,");
            strSql.Append(" EventName = @EventName,");
            strSql.Append(" SolvTtheProblem = @SolvTtheProblem,");
            strSql.Append(" Remarks = @Remarks,");
            strSql.Append(" modifytime = @modifytime,");
            strSql.Append(" modifyman = @modifyman,");
            strSql.Append("codeContract=@codeContract,");
            strSql.Append("FishMealId=@FishMealId,");
            strSql.Append("Chargeback=@Chargeback");
            strSql.Append(" where id = @id");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@ContractNo",      MySqlDbType.VarChar,     45),
                new MySqlParameter("@occurDate",       MySqlDbType.DateTime),
                new MySqlParameter("@EventName",       MySqlDbType.VarChar,    500),
                new MySqlParameter("@SolvTtheProblem", MySqlDbType.VarChar,    500),
                new MySqlParameter("@Remarks",         MySqlDbType.VarChar,    500),
                new MySqlParameter("@modifytime",      MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",    MySqlDbType.VarChar,    200),
                new MySqlParameter("@id",              MySqlDbType.Int32,       11),
                new MySqlParameter("@Chargeback",      MySqlDbType.Decimal,     45),
                new MySqlParameter("@FishMealId",      MySqlDbType.VarChar, 50)
            };
            parameters[0].Value  = model.ContractNo;
            parameters[1].Value  = model.OccurDate;
            parameters[2].Value  = model.EventName;
            parameters[3].Value  = model.SolvTtheProblem;
            parameters[4].Value  = model.Remarks;
            parameters[5].Value  = model.Modifytime;
            parameters[6].Value  = model.Modifyman;
            parameters [7].Value = model.codeContract;
            parameters [8].Value = model.Id;
            parameters[9].Value  = model.Chargeback;
            parameters[10].Value = model.FishMealId;
            int rows = MySqlHelper.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                if (model.Chargeback == 0 && model.Code != "")
                {
                    StringBuilder strSql1 = new StringBuilder();
                    strSql1.AppendFormat("insert into t_review (userName,programId,SingleNumber,date,content,state,userNameReview,Numbering) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", FishEntity.Variable.User.username, name, model.Code, DateTime.Now, "自动审核", "审核", "自动审核", model.Numbering);
                    MySqlHelper.ExecuteSqlReturnId(strSql1.ToString(), null);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override void Save()
        {
            decimal temp = 0;

            FishEntity.TheproblemsheetEntity _The = new FishEntity.TheproblemsheetEntity();
            _The.Code       = FishBll.Bll.SequenceUtil.GetTheproblemsheet();
            _The.ContractNo = txtContractNo.Text;
            decimal.TryParse(txtChargeback.Text, out temp);
            _The.Chargeback      = temp;
            _The.OccurDate       = dtpoccurDate.Value;
            _The.EventName       = txtEventName.Text;
            _The.SolvTtheProblem = txtSolvTtheProblem.Text;
            _The.Remarks         = txtRemarks.Text;
            _The.Createtime      = DateTime.Now;
            _The.Createman       = FishEntity.Variable.User.username;
            _The.Modifytime      = DateTime.Now;
            _The.Modifyman       = _The.Createman;
            _The.codeContract    = txtCodeOdd.Text;
            _The.Numbering       = txtNumbering.Text;
            FishBll.Bll.TheproblemsheetBll bll = new FishBll.Bll.TheproblemsheetBll();
            bool isok = bll.Exists(_The.Code);

            while (isok)
            {
                _The.Code = FishBll.Bll.SequenceUtil.GetTheproblemsheet();
                isok      = bll.Exists(_The.Code);
            }
            int id = bll.Add(_The);

            if (id > 0)
            {
                _The.Id = id;
                if (txtNumbering.Text != "")
                {
                    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                    _Refreshbll.GetFormTheproblemsheet(txtNumbering.Text);
                }
                tmiQuery.Visible  = false;
                tmiDelete.Visible = false;
                tmiModify.Visible = false;
                tmiSave.Visible   = false;
                tmiAdd.Visible    = false;
                tmiCancel.Visible = true;
                MessageBox.Show("添加成功。");
                txtcode.Text = _The.Code;
            }
            else
            {
                txtcode.Text = _The.Code;
                MessageBox.Show("添加失败。");
            }
        }
        public bool Update(FishEntity.TheproblemsheetEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update t_theproblemsheet set ");
            strSql.Append(" ContractNo = @ContractNo,");
            strSql.Append(" occurDate = @occurDate,");
            strSql.Append(" EventName = @EventName,");
            strSql.Append(" SolvTtheProblem = @SolvTtheProblem,");
            strSql.Append(" Remarks = @Remarks,");
            strSql.Append(" modifytime = @modifytime,");
            strSql.Append(" modifyman = @modifyman,");
            strSql.Append("codeContract=@codeContract,");
            strSql.Append("Chargeback=@Chargeback");
            strSql.Append(" where id = @id");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@ContractNo",      MySqlDbType.VarChar,     45),
                new MySqlParameter("@occurDate",       MySqlDbType.DateTime),
                new MySqlParameter("@EventName",       MySqlDbType.VarChar,    500),
                new MySqlParameter("@SolvTtheProblem", MySqlDbType.VarChar,    500),
                new MySqlParameter("@Remarks",         MySqlDbType.VarChar,    500),
                new MySqlParameter("@modifytime",      MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",    MySqlDbType.VarChar,    200),
                new MySqlParameter("@id",              MySqlDbType.Int32,       11),
                new MySqlParameter("@Chargeback",      MySqlDbType.Decimal, 45)
            };
            parameters[0].Value  = model.ContractNo;
            parameters[1].Value  = model.OccurDate;
            parameters[2].Value  = model.EventName;
            parameters[3].Value  = model.SolvTtheProblem;
            parameters[4].Value  = model.Remarks;
            parameters[5].Value  = model.Modifytime;
            parameters[6].Value  = model.Modifyman;
            parameters [7].Value = model.codeContract;
            parameters [8].Value = model.Id;
            parameters[9].Value  = model.Chargeback;
            int rows = MySqlHelper.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #6
0
        public int Add(FishEntity.TheproblemsheetEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into t_theproblemsheet(Numbering,code, ContractNo, occurDate, EventName, SolvTtheProblem, Remarks, createtime, createman, modifytime, modifyman,codeContract,Chargeback,FishMealId) ");
            strSql.Append("values(@Numbering,@code, @ContractNo, @occurDate, @EventName, @SolvTtheProblem, @Remarks, @createtime, @createman, @modifytime, @modifyman,@codeContract,@Chargeback,@FishMealId); select last_insert_id();");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@code",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@ContractNo",      MySqlDbType.VarChar,     45),
                new MySqlParameter("@occurDate",       MySqlDbType.DateTime),
                new MySqlParameter("@EventName",       MySqlDbType.VarChar,    500),
                new MySqlParameter("@SolvTtheProblem", MySqlDbType.VarChar,    500),
                new MySqlParameter("@Remarks",         MySqlDbType.VarChar,    500),
                new MySqlParameter("@createtime",      MySqlDbType.Timestamp),
                new MySqlParameter("@createman",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",      MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",    MySqlDbType.VarChar,    200),
                new MySqlParameter("@Chargeback",      MySqlDbType.Decimal,     45),
                new MySqlParameter("@Numbering",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@FishMealId",      MySqlDbType.VarChar, 50)
            };
            parameters[0].Value   = model.Code;
            parameters[1].Value   = model.ContractNo;
            parameters[2].Value   = model.OccurDate;
            parameters[3].Value   = model.EventName;
            parameters[4].Value   = model.SolvTtheProblem;
            parameters[5].Value   = model.Remarks;
            parameters[6].Value   = model.Createtime;
            parameters[7].Value   = model.Createman;
            parameters[8].Value   = model.Modifytime;
            parameters[9].Value   = model.Modifyman;
            parameters [10].Value = model.codeContract;
            parameters[11].Value  = model.Chargeback;
            parameters[12].Value  = model.Numbering;
            parameters[13].Value  = model.FishMealId;
            int id = MySqlHelper.ExecuteSqlReturnId(strSql.ToString(), parameters);

            return(id);
        }
Beispiel #7
0
        public int Add(FishEntity.TheproblemsheetEntity model, string name)
        {
            Hashtable SQLString = new Hashtable( );

            SQLString = ReviewInfo.getSQLString(name, model.Code, string.Empty, SQLString);

            StringBuilder strSql = new StringBuilder( );

            strSql.Append("insert into t_theproblemsheet(Numbering,code, ContractNo, occurDate, EventName, SolvTtheProblem, Remarks, createtime, createman, modifytime, modifyman,codeContract,Chargeback,FishMealId) ");
            strSql.Append("values(@Numbering,@code, @ContractNo, @occurDate, @EventName, @SolvTtheProblem, @Remarks, @createtime, @createman, @modifytime, @modifyman,@codeContract,@Chargeback,@FishMealId); ");     //select last_insert_id();
            MySqlParameter [] parameters =
            {
                new MySqlParameter("@code",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@ContractNo",      MySqlDbType.VarChar,     45),
                new MySqlParameter("@occurDate",       MySqlDbType.DateTime),
                new MySqlParameter("@EventName",       MySqlDbType.VarChar,    500),
                new MySqlParameter("@SolvTtheProblem", MySqlDbType.VarChar,    500),
                new MySqlParameter("@Remarks",         MySqlDbType.VarChar,    500),
                new MySqlParameter("@createtime",      MySqlDbType.Timestamp),
                new MySqlParameter("@createman",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",      MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",    MySqlDbType.VarChar,    200),
                new MySqlParameter("@Chargeback",      MySqlDbType.Decimal,     45),
                new MySqlParameter("@Numbering",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@FishMealId",      MySqlDbType.VarChar, 50)
            };
            parameters [0].Value  = model.Code;
            parameters [1].Value  = model.ContractNo;
            parameters [2].Value  = model.OccurDate;
            parameters [3].Value  = model.EventName;
            parameters [4].Value  = model.SolvTtheProblem;
            parameters [5].Value  = model.Remarks;
            parameters [6].Value  = model.Createtime;
            parameters [7].Value  = model.Createman;
            parameters [8].Value  = model.Modifytime;
            parameters [9].Value  = model.Modifyman;
            parameters [10].Value = model.codeContract;
            parameters [11].Value = model.Chargeback;
            parameters [12].Value = model.Numbering;
            parameters [13].Value = model.FishMealId;
            SQLString.Add(strSql, parameters);
            if (MySqlHelper.ExecuteSqlTran(SQLString))
            {
                strSql = new StringBuilder( );
                strSql.AppendFormat("select id,code from t_theproblemsheet where code='{0}'", model.Code);
                DataTable dt = MySqlHelper.Query(strSql.ToString( )).Tables [0];
                if (model.Chargeback == 0 && dt.Rows[0]["code"].ToString() != "")
                {
                    StringBuilder strSql1 = new StringBuilder();
                    strSql1.AppendFormat("insert into t_review (userName,programId,SingleNumber,date,content,state,userNameReview,Numbering) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", FishEntity.Variable.User.username, name, dt.Rows[0]["code"].ToString(), DateTime.Now, "自动审核", "审核", "自动审核", model.Numbering);
                    MySqlHelper.ExecuteSqlReturnId(strSql1.ToString(), null);
                }
                if (dt != null && dt.Rows.Count > 0)
                {
                    return(string.IsNullOrEmpty(dt.Rows[0]["id"].ToString()) == true ? 0 : Convert.ToInt32(dt.Rows[0]["id"].ToString()));
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(0);
            }
        }
Beispiel #8
0
 public bool Update(FishEntity.TheproblemsheetEntity model)
 {
     return(dal.Update(model));
 }
Beispiel #9
0
 public int Add(FishEntity.TheproblemsheetEntity model)
 {
     return(dal.Add(model));
 }
Beispiel #10
0
 public bool Update(FishEntity.TheproblemsheetEntity model, string name)
 {
     return(dal.Update(model, name));
 }
Beispiel #11
0
 public int Add(FishEntity.TheproblemsheetEntity model, string name)
 {
     return(dal.Add(model, name));
 }