Esempio n. 1
0
        public List <PEIS.Model.DctFinalConclusionType> DataTableToList(DataTable dt)
        {
            List <PEIS.Model.DctFinalConclusionType> list = new List <PEIS.Model.DctFinalConclusionType>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    PEIS.Model.DctFinalConclusionType dctFinalConclusionType = new PEIS.Model.DctFinalConclusionType();
                    if (dt.Rows[i]["ID_FinalConclusionType"].ToString() != "")
                    {
                        dctFinalConclusionType.ID_FinalConclusionType = int.Parse(dt.Rows[i]["ID_FinalConclusionType"].ToString());
                    }
                    dctFinalConclusionType.FinalConclusionTypeName = dt.Rows[i]["FinalConclusionTypeName"].ToString();
                    dctFinalConclusionType.InputCode = dt.Rows[i]["InputCode"].ToString();
                    dctFinalConclusionType.Note      = dt.Rows[i]["Note"].ToString();
                    if (dt.Rows[i]["ID_Creator"].ToString() != "")
                    {
                        dctFinalConclusionType.ID_Creator = new int?(int.Parse(dt.Rows[i]["ID_Creator"].ToString()));
                    }
                    if (dt.Rows[i]["CreateDate"].ToString() != "")
                    {
                        dctFinalConclusionType.CreateDate = new DateTime?(DateTime.Parse(dt.Rows[i]["CreateDate"].ToString()));
                    }
                    if (dt.Rows[i]["Is_Banned"].ToString() != "")
                    {
                        if (dt.Rows[i]["Is_Banned"].ToString() == "1" || dt.Rows[i]["Is_Banned"].ToString().ToLower() == "true")
                        {
                            dctFinalConclusionType.Is_Banned = new bool?(true);
                        }
                        else
                        {
                            dctFinalConclusionType.Is_Banned = new bool?(false);
                        }
                    }
                    if (dt.Rows[i]["ID_BanOpr"].ToString() != "")
                    {
                        dctFinalConclusionType.ID_BanOpr = new int?(int.Parse(dt.Rows[i]["ID_BanOpr"].ToString()));
                    }
                    dctFinalConclusionType.BanDescribe = dt.Rows[i]["BanDescribe"].ToString();
                    if (dt.Rows[i]["DispOrder"].ToString() != "")
                    {
                        dctFinalConclusionType.DispOrder = int.Parse(dt.Rows[i]["DispOrder"].ToString());
                    }
                    if (dt.Rows[i]["BanDate"].ToString() != "")
                    {
                        dctFinalConclusionType.BanDate = new DateTime?(DateTime.Parse(dt.Rows[i]["BanDate"].ToString()));
                    }
                    dctFinalConclusionType.BanOperator             = dt.Rows[i]["BanOperator"].ToString();
                    dctFinalConclusionType.FinalConclusionSignCode = dt.Rows[i]["FinalConclusionSignCode"].ToString();
                    list.Add(dctFinalConclusionType);
                }
            }
            return(list);
        }
Esempio n. 2
0
        public bool Update(PEIS.Model.DctFinalConclusionType model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("update DctFinalConclusionType set ");
            stringBuilder.Append("FinalConclusionTypeName=@FinalConclusionTypeName,");
            stringBuilder.Append("InputCode=@InputCode,");
            stringBuilder.Append("Note=@Note,");
            stringBuilder.Append("ID_Creator=@ID_Creator,");
            stringBuilder.Append("CreateDate=@CreateDate,");
            stringBuilder.Append("Is_Banned=@Is_Banned,");
            stringBuilder.Append("ID_BanOpr=@ID_BanOpr,");
            stringBuilder.Append("BanDescribe=@BanDescribe,");
            stringBuilder.Append("DispOrder=@DispOrder,");
            stringBuilder.Append("BanDate=@BanDate,");
            stringBuilder.Append("BanOperator=@BanOperator,");
            stringBuilder.Append("FinalConclusionSignCode=@FinalConclusionSignCode");
            stringBuilder.Append(" where ID_FinalConclusionType=@ID_FinalConclusionType");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@FinalConclusionTypeName", SqlDbType.VarChar, 50),
                new SqlParameter("@InputCode", SqlDbType.VarChar, 20),
                new SqlParameter("@Note", SqlDbType.VarChar, 50),
                new SqlParameter("@ID_Creator", SqlDbType.Int, 4),
                new SqlParameter("@CreateDate", SqlDbType.DateTime),
                new SqlParameter("@Is_Banned", SqlDbType.Bit, 1),
                new SqlParameter("@ID_BanOpr", SqlDbType.Int, 4),
                new SqlParameter("@BanDescribe", SqlDbType.VarChar, 50),
                new SqlParameter("@DispOrder", SqlDbType.Int, 4),
                new SqlParameter("@BanDate", SqlDbType.DateTime),
                new SqlParameter("@BanOperator", SqlDbType.VarChar, 30),
                new SqlParameter("@FinalConclusionSignCode", SqlDbType.VarChar, 30),
                new SqlParameter("@ID_FinalConclusionType", SqlDbType.Int, 4)
            };
            array[0].Value  = model.FinalConclusionTypeName;
            array[1].Value  = model.InputCode;
            array[2].Value  = model.Note;
            array[3].Value  = model.ID_Creator;
            array[4].Value  = model.CreateDate;
            array[5].Value  = model.Is_Banned;
            array[6].Value  = model.ID_BanOpr;
            array[7].Value  = model.BanDescribe;
            array[8].Value  = model.DispOrder;
            array[9].Value  = model.BanDate;
            array[10].Value = model.BanOperator;
            array[11].Value = model.FinalConclusionSignCode;
            array[12].Value = model.ID_FinalConclusionType;
            int num = DbHelperSQL.ExecuteSql(stringBuilder.ToString(), array);

            return(num > 0);
        }
Esempio n. 3
0
        public int Add(PEIS.Model.DctFinalConclusionType model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("insert into DctFinalConclusionType(");
            stringBuilder.Append("FinalConclusionTypeName,InputCode,Note,ID_Creator,CreateDate,Is_Banned,ID_BanOpr,BanDescribe,DispOrder,BanDate,BanOperator,FinalConclusionSignCode)");
            stringBuilder.Append(" values (");
            stringBuilder.Append("@FinalConclusionTypeName,@InputCode,@Note,@ID_Creator,@CreateDate,@Is_Banned,@ID_BanOpr,@BanDescribe,@DispOrder,@BanDate,@BanOperator,@FinalConclusionSignCode)");
            stringBuilder.Append(";select @@IDENTITY");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@FinalConclusionTypeName", SqlDbType.VarChar, 50),
                new SqlParameter("@InputCode", SqlDbType.VarChar, 20),
                new SqlParameter("@Note", SqlDbType.VarChar, 50),
                new SqlParameter("@ID_Creator", SqlDbType.Int, 4),
                new SqlParameter("@CreateDate", SqlDbType.DateTime),
                new SqlParameter("@Is_Banned", SqlDbType.Bit, 1),
                new SqlParameter("@ID_BanOpr", SqlDbType.Int, 4),
                new SqlParameter("@BanDescribe", SqlDbType.VarChar, 50),
                new SqlParameter("@DispOrder", SqlDbType.Int, 4),
                new SqlParameter("@BanDate", SqlDbType.DateTime),
                new SqlParameter("@BanOperator", SqlDbType.VarChar, 30),
                new SqlParameter("@FinalConclusionSignCode", SqlDbType.VarChar, 30)
            };
            array[0].Value  = model.FinalConclusionTypeName;
            array[1].Value  = model.InputCode;
            array[2].Value  = model.Note;
            array[3].Value  = model.ID_Creator;
            array[4].Value  = model.CreateDate;
            array[5].Value  = model.Is_Banned;
            array[6].Value  = model.ID_BanOpr;
            array[7].Value  = model.BanDescribe;
            array[8].Value  = model.DispOrder;
            array[9].Value  = model.BanDate;
            array[10].Value = model.BanOperator;
            array[11].Value = model.FinalConclusionSignCode;
            object single = DbHelperSQL.GetSingle(stringBuilder.ToString(), array);
            int    result;

            if (single == null)
            {
                result = 0;
            }
            else
            {
                result = Convert.ToInt32(single);
            }
            return(result);
        }
 protected void GetEditFinalConclusionTypeInfo(int ID_FinalConclusionType, ref VelocityContext vltContext)
 {
     if (ID_FinalConclusionType > 0)
     {
         PEIS.Model.DctFinalConclusionType model = PEIS.BLL.DctFinalConclusionType.Instance.GetModel(ID_FinalConclusionType);
         if (null != model)
         {
             vltContext.Put("ID_FinalConclusionType", model.ID_FinalConclusionType);
             vltContext.Put("FinalConclusionTypeName", model.FinalConclusionTypeName);
             vltContext.Put("Is_Banned", model.Is_Banned);
             vltContext.Put("ID_BanOpr", model.ID_BanOpr);
             vltContext.Put("BanOperator", model.BanOperator);
             vltContext.Put("BanDescribe", model.BanDescribe);
             vltContext.Put("BanDate", model.BanDate);
             vltContext.Put("DispOrder", model.DispOrder);
             vltContext.Put("Note", model.Note);
             vltContext.Put("FinalConclusionSignCode", model.FinalConclusionSignCode);
         }
     }
 }
Esempio n. 5
0
 public bool Update(PEIS.Model.DctFinalConclusionType model)
 {
     return(this.dal.Update(model));
 }
Esempio n. 6
0
 public int Add(PEIS.Model.DctFinalConclusionType model)
 {
     return(this.dal.Add(model));
 }
Esempio n. 7
0
 public int SaveFinalConclusionType(PEIS.Model.DctFinalConclusionType FinalConclusionTypeModel)
 {
     return(CommonConfig.dal.SaveFinalConclusionType(FinalConclusionTypeModel));
 }
Esempio n. 8
0
        public PEIS.Model.DctFinalConclusionType GetModel(int ID_FinalConclusionType)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("select  top 1 ID_FinalConclusionType,FinalConclusionTypeName,InputCode,Note,ID_Creator,CreateDate,Is_Banned,ID_BanOpr,BanDescribe,DispOrder,BanDate,BanOperator,FinalConclusionSignCode from DctFinalConclusionType ");
            stringBuilder.Append(" where ID_FinalConclusionType=@ID_FinalConclusionType");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ID_FinalConclusionType", SqlDbType.Int, 4)
            };
            array[0].Value = ID_FinalConclusionType;
            PEIS.Model.DctFinalConclusionType dctFinalConclusionType = new PEIS.Model.DctFinalConclusionType();
            DataSet dataSet = DbHelperSQL.Query(stringBuilder.ToString(), array);

            PEIS.Model.DctFinalConclusionType result;
            if (dataSet.Tables[0].Rows.Count > 0)
            {
                if (dataSet.Tables[0].Rows[0]["ID_FinalConclusionType"].ToString() != "")
                {
                    dctFinalConclusionType.ID_FinalConclusionType = int.Parse(dataSet.Tables[0].Rows[0]["ID_FinalConclusionType"].ToString());
                }
                dctFinalConclusionType.FinalConclusionTypeName = dataSet.Tables[0].Rows[0]["FinalConclusionTypeName"].ToString();
                dctFinalConclusionType.InputCode = dataSet.Tables[0].Rows[0]["InputCode"].ToString();
                dctFinalConclusionType.Note      = dataSet.Tables[0].Rows[0]["Note"].ToString();
                if (dataSet.Tables[0].Rows[0]["ID_Creator"].ToString() != "")
                {
                    dctFinalConclusionType.ID_Creator = new int?(int.Parse(dataSet.Tables[0].Rows[0]["ID_Creator"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["CreateDate"].ToString() != "")
                {
                    dctFinalConclusionType.CreateDate = new DateTime?(DateTime.Parse(dataSet.Tables[0].Rows[0]["CreateDate"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["Is_Banned"].ToString() != "")
                {
                    if (dataSet.Tables[0].Rows[0]["Is_Banned"].ToString() == "1" || dataSet.Tables[0].Rows[0]["Is_Banned"].ToString().ToLower() == "true")
                    {
                        dctFinalConclusionType.Is_Banned = new bool?(true);
                    }
                    else
                    {
                        dctFinalConclusionType.Is_Banned = new bool?(false);
                    }
                }
                if (dataSet.Tables[0].Rows[0]["ID_BanOpr"].ToString() != "")
                {
                    dctFinalConclusionType.ID_BanOpr = new int?(int.Parse(dataSet.Tables[0].Rows[0]["ID_BanOpr"].ToString()));
                }
                dctFinalConclusionType.BanDescribe = dataSet.Tables[0].Rows[0]["BanDescribe"].ToString();
                if (dataSet.Tables[0].Rows[0]["DispOrder"].ToString() != "")
                {
                    dctFinalConclusionType.DispOrder = int.Parse(dataSet.Tables[0].Rows[0]["DispOrder"].ToString());
                }
                if (dataSet.Tables[0].Rows[0]["BanDate"].ToString() != "")
                {
                    dctFinalConclusionType.BanDate = new DateTime?(DateTime.Parse(dataSet.Tables[0].Rows[0]["BanDate"].ToString()));
                }
                dctFinalConclusionType.BanOperator             = dataSet.Tables[0].Rows[0]["BanOperator"].ToString();
                dctFinalConclusionType.FinalConclusionSignCode = dataSet.Tables[0].Rows[0]["FinalConclusionSignCode"].ToString();
                result = dctFinalConclusionType;
            }
            else
            {
                result = null;
            }
            return(result);
        }