Esempio n. 1
0
        /// <summary>
        ///根据SQL语句返回集合
        /// </summary>
        private IList <Tbl_ProjectDesigner> getTbl_ProjectDesignersBySql(string sql)
        {
            IList <Tbl_ProjectDesigner> list = new List <Tbl_ProjectDesigner>();
            DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql);

            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    Tbl_ProjectDesigner tbl_projectdesigner = new Tbl_ProjectDesigner();
                    tbl_projectdesigner.ID           = Convert.ToInt32(dr["ID"]);
                    tbl_projectdesigner.ProjectID    = Convert.ToInt32(dr["ProjectID"]);
                    tbl_projectdesigner.ClassName    = Convert.ToString(dr["ClassName"]);
                    tbl_projectdesigner.UserName     = Convert.ToString(dr["UserName"]);
                    tbl_projectdesigner.DesignerType = Convert.ToString(dr["DesignerType"]);
                    tbl_projectdesigner.DealFlag     = Convert.ToInt32(dr["DealFlag"]);
                    tbl_projectdesigner.DealUser     = Convert.ToString(dr["DealUser"]);
                    tbl_projectdesigner.DealTime     = Convert.ToDateTime(dr["DealTime"]);
                    tbl_projectdesigner.AddDate      = Convert.ToDateTime(dr["AddDate"]);
                    list.Add(tbl_projectdesigner);
                }
            }
            return(list);
        }
 public static int UpdateTbl_ProjectDesigner(Tbl_ProjectDesigner tbl_projectdesigner)
 {
     WebCommon.Public.WriteLog("修改主设:" + tbl_projectdesigner.UserName);
     tbl_projectdesigner.DealUser = WebCommon.Public.GetUserName();
     tbl_projectdesigner.DealTime = DateTime.Now;
     return(new Tbl_ProjectDesignerService().UpdateTbl_ProjectDesignerById(tbl_projectdesigner));
 }
Esempio n. 3
0
        public int AddTbl_ProjectDesigner(Tbl_ProjectDesigner tbl_projectdesigner)
        {
            string sql = "insert into [Tbl_ProjectDesigner] ([ProjectID],[ClassName],[UserName],[DesignerType],[DealUser]) values (@ProjectID,@ClassName,@UserName,@DesignerType,@DealUser)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ProjectID", tbl_projectdesigner.ProjectID),
                new SqlParameter("@ClassName", tbl_projectdesigner.ClassName),
                new SqlParameter("@UserName", tbl_projectdesigner.UserName),
                new SqlParameter("@DesignerType", tbl_projectdesigner.DesignerType),
                new SqlParameter("@DealUser", tbl_projectdesigner.DealUser),
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
Esempio n. 4
0
        public int UpdateTbl_ProjectDesignerById(Tbl_ProjectDesigner tbl_projectdesigner)
        {
            string sql = "update [Tbl_ProjectDesigner] set [ClassName]=@ClassName,[UserName]=@UserName,[DesignerType]=@DesignerType,[DealUser]=@DealUser,[DealTime]=@DealTime where DealFlag=0 and [ID]=@ID";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ClassName", tbl_projectdesigner.ClassName),
                new SqlParameter("@UserName", tbl_projectdesigner.UserName),
                new SqlParameter("@DesignerType", tbl_projectdesigner.DesignerType),
                new SqlParameter("@DealUser", tbl_projectdesigner.DealUser),
                new SqlParameter("@DealTime", tbl_projectdesigner.DealTime.ToString()),
                new SqlParameter("@Tbl_ProjectDesigner", tbl_projectdesigner.ID)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
 public static int AddTbl_ProjectDesigner(Tbl_ProjectDesigner tbl_projectdesigner)
 {
     WebCommon.Public.WriteLog("添加主设:" + tbl_projectdesigner.UserName);
     return(new Tbl_ProjectDesignerService().AddTbl_ProjectDesigner(tbl_projectdesigner));
 }