Пример #1
0
 void EditHeader(Dictionary <object, object> SQLString, StringBuilder strSql, LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model)
 {
     strSql = new StringBuilder( );
     strSql.Append("update MIKANT set ");
     strSql.Append("ANT002=@ANT002,");
     strSql.Append("ANT003=@ANT003,");
     strSql.Append("ANT004=@ANT004,");
     strSql.Append("ANT005=@ANT005,");
     strSql.Append("ANT006=@ANT006,");
     strSql.Append("ANT007=@ANT007,");
     strSql.Append("ANT009=@ANT009,");
     strSql.Append("ANT010=@ANT010,");
     strSql.Append("ANT011=@ANT011,");
     strSql.Append("ANT012=@ANT012,");
     strSql.Append("ANT014=@ANT014,");
     strSql.Append("ANT015=@ANT015,");
     strSql.Append("ANT016=@ANT016,");
     strSql.Append("ANT017=@ANT017 ");
     strSql.Append(" where ANT001=@ANT001");
     SqlParameter [] parameters =
     {
         new SqlParameter("@ANT002", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT003", SqlDbType.NVarChar,   50),
         new SqlParameter("@ANT004", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT005", SqlDbType.NVarChar,   50),
         new SqlParameter("@ANT006", SqlDbType.Bit,         1),
         new SqlParameter("@ANT007", SqlDbType.Bit,         1),
         new SqlParameter("@ANT001", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT009", SqlDbType.Decimal),
         new SqlParameter("@ANT010", SqlDbType.Decimal),
         new SqlParameter("@ANT011", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT012", SqlDbType.NVarChar,  100),
         new SqlParameter("@ANT014", SqlDbType.DateTime),
         new SqlParameter("@ANT015", SqlDbType.DateTime),
         new SqlParameter("@ANT016", SqlDbType.Decimal),
         new SqlParameter("@ANT017", SqlDbType.Decimal)
     };
     parameters [0].Value  = model.ANT002;
     parameters [1].Value  = model.ANT003;
     parameters [2].Value  = model.ANT004;
     parameters [3].Value  = model.ANT005;
     parameters [4].Value  = model.ANT006;
     parameters [5].Value  = model.ANT007;
     parameters [6].Value  = model.ANT001;
     parameters [7].Value  = model.ANT009;
     parameters [8].Value  = model.ANT010;
     parameters [9].Value  = model.ANT011;
     parameters [10].Value = model.ANT012;
     parameters [11].Value = model.ANT014;
     parameters [12].Value = model.ANT015;
     parameters [13].Value = model.ANT016;
     parameters [14].Value = model.ANT017;
     SQLString.Add(strSql, parameters);
 }
Пример #2
0
        /// <summary>
        /// 注销
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Cancella(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("UPDATE MIKANT SET ANT007=@ANT007 WHERE ANT001=@ANT001");
            SqlParameter [] parameter =
            {
                new SqlParameter("@ANT007", SqlDbType.Bit),
                new SqlParameter("@ANT001", SqlDbType.NVarChar, 20)
            };
            parameter [0].Value = model.ANT007;
            parameter [1].Value = model.ANT001;

            return(SqlHelper.ExecuteNonQueryResult(strSql.ToString( ), parameter));
        }
Пример #3
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Examine(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model)
        {
            Dictionary <object, object> SQLString = new Dictionary <object, object> ( );

            StringBuilder strSql = new StringBuilder( );

            strSql.Append("UPDATE MIKANT SET ANT006=@ANT006 WHERE ANT001=@ANT001");
            SqlParameter [] parameter =
            {
                new SqlParameter("@ANT006", SqlDbType.Bit),
                new SqlParameter("@ANT001", SqlDbType.NVarChar, 20)
            };
            parameter [0].Value = model.ANT006;
            parameter [1].Value = model.ANT001;
            SQLString.Add(strSql, parameter);

            return(SqlHelper.ExecuteSqlTranDic(SQLString));
        }
Пример #4
0
 void AddHeader(Dictionary <object, object> SQLString, StringBuilder strSql, LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model)
 {
     strSql = new StringBuilder( );
     strSql = new StringBuilder( );
     strSql.Append("insert into MIKANT(");
     strSql.Append("ANT001,ANT002,ANT003,ANT004,ANT005,ANT008,ANT009,ANT010,ANT011,ANT012,ANT013,ANT014,ANT015,ANT016,ANT017)");
     strSql.Append(" values (");
     strSql.Append("@ANT001,@ANT002,@ANT003,@ANT004,@ANT005,@ANT008,@ANT009,@ANT010,@ANT011,@ANT012,@ANT013,@ANT014,@ANT015,@ANT016,@ANT017)");
     SqlParameter [] parameters =
     {
         new SqlParameter("@ANT001", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT002", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT003", SqlDbType.NVarChar,   50),
         new SqlParameter("@ANT004", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT005", SqlDbType.NVarChar,   50),
         new SqlParameter("@ANT008", SqlDbType.Date,        3),
         new SqlParameter("@ANT009", SqlDbType.Decimal),
         new SqlParameter("@ANT010", SqlDbType.Decimal),
         new SqlParameter("@ANT011", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT012", SqlDbType.NVarChar,  100),
         new SqlParameter("@ANT013", SqlDbType.NVarChar,   20),
         new SqlParameter("@ANT014", SqlDbType.DateTime),
         new SqlParameter("@ANT015", SqlDbType.DateTime),
         new SqlParameter("@ANT016", SqlDbType.Decimal),
         new SqlParameter("@ANT017", SqlDbType.Decimal)
     };
     parameters [0].Value  = model.ANT001;
     parameters [1].Value  = model.ANT002;
     parameters [2].Value  = model.ANT003;
     parameters [3].Value  = model.ANT004;
     parameters [4].Value  = model.ANT005;
     parameters [5].Value  = model.ANT008;
     parameters [6].Value  = model.ANT009;
     parameters [7].Value  = model.ANT010;
     parameters [8].Value  = model.ANT011;
     parameters [9].Value  = model.ANT012;
     parameters [10].Value = model.ANT013;
     parameters [11].Value = model.ANT014;
     parameters [12].Value = model.ANT015;
     parameters [13].Value = model.ANT016;
     parameters [14].Value = model.ANT017;
     SQLString.Add(strSql, parameters);
 }
Пример #5
0
 /// <summary>
 /// 保存
 /// </summary>
 /// <param name="model"></param>
 /// <param name="tableViewOne"></param>
 /// <param name="tableViewTwo"></param>
 /// <returns></returns>
 public bool Save(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model, DataTable tableViewOne, DataTable tableViewTwo)
 {
     return(dal.Save(model, tableViewOne, tableViewTwo));
 }
Пример #6
0
 /// <summary>
 /// 注销
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Cancella(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model)
 {
     return(dal.Cancella(model));
 }
Пример #7
0
 /// <summary>
 /// 审核
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Examine(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model)
 {
     return(dal.Examine(model));
 }
Пример #8
0
 /// <summary>
 /// 编辑数据
 /// </summary>
 /// <param name="model"></param>
 /// <param name="tableViewOne"></param>
 /// <param name="tableViewTwo"></param>
 /// <param name="idxOne"></param>
 /// <param name="idxTwo"></param>
 /// <returns></returns>
 public bool Edit(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model, DataTable tableViewOne, DataTable tableViewTwo, List <string> idxOne, List <string> idxTwo)
 {
     return(dal.Edit(model, tableViewOne, tableViewTwo, idxOne, idxTwo));
 }
Пример #9
0
 public LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity getModel(DataRow row)
 {
     LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model = new LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity( );
     if (row != null)
     {
         if (row ["ANT001"] != null)
         {
             model.ANT001 = row ["ANT001"].ToString( );
         }
         if (row ["ANT002"] != null)
         {
             model.ANT002 = row ["ANT002"].ToString( );
         }
         if (row ["ANT003"] != null)
         {
             model.ANT003 = row ["ANT003"].ToString( );
         }
         if (row ["ANT004"] != null)
         {
             model.ANT004 = row ["ANT004"].ToString( );
         }
         if (row ["ANT005"] != null)
         {
             model.ANT005 = row ["ANT005"].ToString( );
         }
         if (row ["ANT006"] != null && row ["ANT006"].ToString( ) != "")
         {
             if ((row ["ANT006"].ToString( ) == "1") || (row ["ANT006"].ToString( ).ToLower( ) == "true"))
             {
                 model.ANT006 = true;
             }
             else
             {
                 model.ANT006 = false;
             }
         }
         if (row ["ANT007"] != null && row ["ANT007"].ToString( ) != "")
         {
             if ((row ["ANT007"].ToString( ) == "1") || (row ["ANT007"].ToString( ).ToLower( ) == "true"))
             {
                 model.ANT007 = true;
             }
             else
             {
                 model.ANT007 = false;
             }
         }
         if (row ["ANT008"] != null && row ["ANT008"].ToString( ) != "")
         {
             model.ANT008 = DateTime.Parse(row ["ANT008"].ToString( ));
         }
         if (row ["ANT009"] != null && row ["ANT009"].ToString( ) != "")
         {
             model.ANT009 = decimal.Parse(row ["ANT009"].ToString( ));
         }
         if (row ["ANT010"] != null && row ["ANT010"].ToString( ) != "")
         {
             model.ANT010 = decimal.Parse(row ["ANT010"].ToString( ));
         }
         if (row ["ANT011"] != null && row ["ANT011"].ToString( ) != "")
         {
             model.ANT011 = row ["ANT011"].ToString( );
         }
         if (row ["ANT012"] != null && row ["ANT012"].ToString( ) != "")
         {
             model.ANT012 = row ["ANT012"].ToString( );
         }
         if (row ["ANT013"] != null && row ["ANT013"].ToString( ) != "")
         {
             model.ANT013 = row ["ANT013"].ToString( );
         }
         if (row ["ANT014"] != null && row ["ANT014"].ToString( ) != "")
         {
             model.ANT014 = DateTime.Parse(row ["ANT014"].ToString( ));
         }
         if (row ["ANT015"] != null && row ["ANT015"].ToString( ) != "")
         {
             model.ANT015 = DateTime.Parse(row ["ANT015"].ToString( ));
         }
         if (row ["ANT016"] != null && row ["ANT016"].ToString( ) != "")
         {
             model.ANT016 = decimal.Parse(row ["ANT016"].ToString( ));
         }
         if (row ["ANT017"] != null && row ["ANT017"].ToString( ) != "")
         {
             model.ANT017 = decimal.Parse(row ["ANT017"].ToString( ));
         }
     }
     return(model);
 }
Пример #10
0
        /// <summary>
        /// 编辑数据
        /// </summary>
        /// <param name="model"></param>
        /// <param name="tableViewOne"></param>
        /// <param name="tableViewTwo"></param>
        /// <param name="idxOne"></param>
        /// <param name="idxTwo"></param>
        /// <returns></returns>
        public bool Edit(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model, DataTable tableViewOne, DataTable tableViewTwo, List <string> idxOne, List <string> idxTwo)
        {
            Dictionary <object, object> SQLString = new Dictionary <object, object> ( );
            StringBuilder strSql = new StringBuilder( );

            EditHeader(SQLString, strSql, model);

            LineProductMesEntityu.AssNewWorkEnclosureBodyOneEntity modelOne = new LineProductMesEntityu.AssNewWorkEnclosureBodyOneEntity( );
            foreach (DataRow row in tableViewOne.Rows)
            {
                modelOne.idx    = string.IsNullOrEmpty(row ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(row ["idx"].ToString( ));
                modelOne.ANU001 = model.ANT001;
                modelOne.ANU002 = row ["ANU002"].ToString( );
                modelOne.ANU003 = row ["ANU003"].ToString( );
                modelOne.ANU004 = row ["ANU004"].ToString( );
                modelOne.ANU005 = row ["ANU005"].ToString( );
                modelOne.ANU006 = row ["ANU006"].ToString( );
                modelOne.ANU007 = string.IsNullOrEmpty(row ["ANU007"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANU007"].ToString( ));
                modelOne.ANU008 = row ["ANU008"].ToString( );
                modelOne.ANU009 = row ["ANU009"].ToString( );
                modelOne.ANU010 = string.IsNullOrEmpty(row ["ANU010"].ToString( )) == true ? 0 : Convert.ToInt32(row ["ANU010"].ToString( ));
                modelOne.ANU011 = string.IsNullOrEmpty(row ["ANU011"].ToString( )) == true ? 0 : Convert.ToInt32(row ["ANU011"].ToString( ));
                modelOne.ANU012 = row ["ANU012"].ToString( );
                if (modelOne.idx > 0)
                {
                    EditBodyOne(SQLString, strSql, modelOne);
                }
                else
                {
                    AddBodyOne(SQLString, strSql, modelOne);
                }
            }
            LineProductMesEntityu.AssNewWorkEnclosureBodyTwoEntity modelTwo = new LineProductMesEntityu.AssNewWorkEnclosureBodyTwoEntity( );
            foreach (DataRow row in tableViewTwo.Rows)
            {
                modelTwo.idx    = string.IsNullOrEmpty(row ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(row ["idx"].ToString( ));
                modelTwo.ANV001 = model.ANT001;
                modelTwo.ANV002 = row ["ANV002"].ToString( );
                modelTwo.ANV003 = row ["ANV003"].ToString( );
                modelTwo.ANV004 = row ["ANV004"].ToString( );
                if (row ["ANV005"] == null || row ["ANV005"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV005 = null;
                }
                else
                {
                    modelTwo.ANV005 = Convert.ToDateTime(row ["ANV005"]);
                }
                if (row ["ANV006"] == null || row ["ANV006"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV006 = null;
                }
                else
                {
                    modelTwo.ANV006 = Convert.ToDateTime(row ["ANV006"]);
                }
                modelTwo.ANV007 = row ["ANV007"].ToString( );
                modelTwo.ANV008 = row ["ANV008"].ToString( );
                modelTwo.ANV009 = string.IsNullOrEmpty(row ["ANV009"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV009"].ToString( ));
                modelTwo.ANV010 = string.IsNullOrEmpty(row ["ANV010"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV010"].ToString( ));
                modelTwo.ANV011 = row ["ANV011"].ToString( );
                if (row ["ANV013"] == null || row ["ANV013"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV013 = null;
                }
                else
                {
                    modelTwo.ANV013 = Convert.ToDateTime(row ["ANV013"]);
                }
                if (row ["ANV014"] == null || row ["ANV014"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV014 = null;
                }
                else
                {
                    modelTwo.ANV014 = Convert.ToDateTime(row ["ANV014"]);
                }
                modelTwo.ANV015 = string.IsNullOrEmpty(row ["ANV015"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV015"].ToString( ));
                modelTwo.ANV016 = string.IsNullOrEmpty(row ["ANV016"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV016"].ToString( ));
                if (string.IsNullOrEmpty(row ["ANV017"].ToString( )))
                {
                    modelTwo.ANV017 = null;
                }
                else
                {
                    modelTwo.ANV017 = Convert.ToDecimal(row ["ANV017"].ToString( ));
                }
                if (modelTwo.idx > 0)
                {
                    EditBodyTwo(SQLString, strSql, modelTwo);
                }
                else
                {
                    ADDBodyTwo(SQLString, strSql, modelTwo);
                }
            }

            foreach (string s in idxOne)
            {
                DeleteBodyOne(SQLString, strSql, s);
            }

            foreach (string s in idxTwo)
            {
                DeleteBodyTwo(SQLString, strSql, s);
            }

            return(SqlHelper.ExecuteSqlTranDic(SQLString));
        }
Пример #11
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="model"></param>
        /// <param name="tableViewOne"></param>
        /// <param name="tableViewTwo"></param>
        /// <returns></returns>
        public bool Save(LineProductMesEntityu.AssNewWorkEnclosureHeaderEntity model, DataTable tableViewOne, DataTable tableViewTwo)
        {
            Dictionary <object, object> SQLString = new Dictionary <object, object> ( );
            StringBuilder strSql = new StringBuilder( );

            model.ANT001 = getCode( );
            model.ANT013 = UserInfoMation.userName;
            AddHeader(SQLString, strSql, model);
            LineProductMesBll.UserInfoMation.oddNum = model.ANT001;

            LineProductMesEntityu.AssNewWorkEnclosureBodyOneEntity modelOne = new LineProductMesEntityu.AssNewWorkEnclosureBodyOneEntity( );
            foreach (DataRow row in tableViewOne.Rows)
            {
                modelOne.ANU001 = model.ANT001;
                modelOne.ANU002 = row ["ANU002"].ToString( );
                modelOne.ANU003 = row ["ANU003"].ToString( );
                modelOne.ANU004 = row ["ANU004"].ToString( );
                modelOne.ANU005 = row ["ANU005"].ToString( );
                modelOne.ANU006 = row ["ANU006"].ToString( );
                modelOne.ANU007 = string.IsNullOrEmpty(row ["ANU007"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANU007"].ToString( ));
                modelOne.ANU008 = row ["ANU008"].ToString( );
                modelOne.ANU009 = row ["ANU009"].ToString( );
                modelOne.ANU010 = string.IsNullOrEmpty(row ["ANU010"].ToString( )) == true ? 0 : Convert.ToInt32(row ["ANU010"].ToString( ));
                modelOne.ANU011 = string.IsNullOrEmpty(row ["ANU011"].ToString( )) == true ? 0 : Convert.ToInt32(row ["ANU011"].ToString( ));
                modelOne.ANU012 = row ["ANU012"].ToString( );
                AddBodyOne(SQLString, strSql, modelOne);
            }

            LineProductMesEntityu.AssNewWorkEnclosureBodyTwoEntity modelTwo = new LineProductMesEntityu.AssNewWorkEnclosureBodyTwoEntity( );
            foreach (DataRow row in tableViewTwo.Rows)
            {
                modelTwo.ANV001 = model.ANT001;
                modelTwo.ANV002 = row ["ANV002"].ToString( );
                modelTwo.ANV003 = row ["ANV003"].ToString( );
                modelTwo.ANV004 = row ["ANV004"].ToString( );
                if (row ["ANV005"] == null || row ["ANV005"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV005 = null;
                }
                else
                {
                    modelTwo.ANV005 = Convert.ToDateTime(row ["ANV005"]);
                }
                if (row ["ANV006"] == null || row ["ANV006"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV006 = null;
                }
                else
                {
                    modelTwo.ANV006 = Convert.ToDateTime(row ["ANV006"]);
                }
                modelTwo.ANV007 = row ["ANV007"].ToString( );
                modelTwo.ANV008 = row ["ANV008"].ToString( );
                modelTwo.ANV009 = string.IsNullOrEmpty(row ["ANV009"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV009"].ToString( ));
                modelTwo.ANV010 = string.IsNullOrEmpty(row ["ANV010"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV010"].ToString( ));
                modelTwo.ANV011 = row ["ANV011"].ToString( );
                if (row ["ANV013"] == null || row ["ANV013"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV013 = null;
                }
                else
                {
                    modelTwo.ANV013 = Convert.ToDateTime(row ["ANV013"]);
                }
                if (row ["ANV014"] == null || row ["ANV014"].ToString( ) == string.Empty)
                {
                    modelTwo.ANV014 = null;
                }
                else
                {
                    modelTwo.ANV014 = Convert.ToDateTime(row ["ANV014"]);
                }
                modelTwo.ANV015 = string.IsNullOrEmpty(row ["ANV015"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV015"].ToString( ));
                modelTwo.ANV016 = string.IsNullOrEmpty(row ["ANV016"].ToString( )) == true ? 0 : Convert.ToDecimal(row ["ANV016"].ToString( ));
                if (string.IsNullOrEmpty(row ["ANV017"].ToString( )))
                {
                    modelTwo.ANV017 = null;
                }
                else
                {
                    modelTwo.ANV017 = Convert.ToDecimal(row ["ANV017"].ToString( ));
                }
                ADDBodyTwo(SQLString, strSql, modelTwo);
            }

            return(SqlHelper.ExecuteSqlTranDic(SQLString));
        }