예제 #1
0
        public int Update(PrivProjectList model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update CPM_Priv_ProjectList set ");
            builder.Append("BussinessCode='" + model.BussinessCode + "',");
            builder.Append("UserCode='" + model.UserCode + "',");
            builder.Append("ProjectID=" + model.ProjectID);
            builder.Append(string.Concat(new object[] { " where BussinessCode='", model.BussinessCode, "' and UserCode='", model.UserCode, "' and ProjectID=", model.ProjectID, " " }));
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
예제 #2
0
        public int Add(PrivProjectList model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into CPM_Priv_ProjectList(");
            builder.Append("BussinessCode,UserCode,ProjectID");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.BussinessCode + "',");
            builder.Append("'" + model.UserCode + "',");
            builder.Append(model.ProjectID);
            builder.Append(")");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
예제 #3
0
        public PrivProjectList GetModel(string BussinessCode, string UserCode, int ProjectID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select   ");
            builder.Append(" BussinessCode,UserCode,ProjectID ");
            builder.Append(" from CPM_Priv_ProjectList ");
            builder.Append(string.Concat(new object[] { " where BussinessCode='", BussinessCode, "' and UserCode='", UserCode, "' and ProjectID=", ProjectID, " " }));
            PrivProjectList list = new PrivProjectList();
            DataSet         set  = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            list.BussinessCode = set.Tables[0].Rows[0]["BussinessCode"].ToString();
            list.UserCode      = set.Tables[0].Rows[0]["UserCode"].ToString();
            if (set.Tables[0].Rows[0]["ProjectID"].ToString() != "")
            {
                list.ProjectID = int.Parse(set.Tables[0].Rows[0]["ProjectID"].ToString());
            }
            return(list);
        }