Ejemplo n.º 1
0
        public bool Update(Model_BookProductionLog model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update BookProductionLog set ");
            builder.Append("BookId=@BookId,");
            builder.Append("ResourceToResourceFolder_Id=@ResourceToResourceFolder_Id,");
            builder.Append("ParticularYear=@ParticularYear,");
            builder.Append("Resource_Type=@Resource_Type,");
            builder.Append("LogTypeEnum=@LogTypeEnum,");
            builder.Append("CreateUser=@CreateUser,");
            builder.Append("CreateTime=@CreateTime,");
            builder.Append("LogRemark=@LogRemark");
            builder.Append(" where BookProductionLog_Id=@BookProductionLog_Id ");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@BookId", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@ParticularYear", SqlDbType.Int, 4), new SqlParameter("@Resource_Type", SqlDbType.Char, 0x24), new SqlParameter("@LogTypeEnum", SqlDbType.Char, 1), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@LogRemark", SqlDbType.NVarChar, 200), new SqlParameter("@BookProductionLog_Id", SqlDbType.Char, 0x24) };
            cmdParms[0].Value = model.BookId;
            cmdParms[1].Value = model.ResourceToResourceFolder_Id;
            cmdParms[2].Value = model.ParticularYear;
            cmdParms[3].Value = model.Resource_Type;
            cmdParms[4].Value = model.LogTypeEnum;
            cmdParms[5].Value = model.CreateUser;
            cmdParms[6].Value = model.CreateTime;
            cmdParms[7].Value = model.LogRemark;
            cmdParms[8].Value = model.BookProductionLog_Id;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Ejemplo n.º 2
0
        public Model_BookProductionLog DataRowToModel(DataRow row)
        {
            Model_BookProductionLog log = new Model_BookProductionLog();

            if (row != null)
            {
                if (row["BookProductionLog_Id"] != null)
                {
                    log.BookProductionLog_Id = row["BookProductionLog_Id"].ToString();
                }
                if (row["BookId"] != null)
                {
                    log.BookId = row["BookId"].ToString();
                }
                if (row["ResourceToResourceFolder_Id"] != null)
                {
                    log.ResourceToResourceFolder_Id = row["ResourceToResourceFolder_Id"].ToString();
                }
                if ((row["ParticularYear"] != null) && (row["ParticularYear"].ToString() != ""))
                {
                    log.ParticularYear = int.Parse(row["ParticularYear"].ToString());
                }
                if (row["Resource_Type"] != null)
                {
                    log.Resource_Type = row["Resource_Type"].ToString();
                }
                if (row["LogTypeEnum"] != null)
                {
                    log.LogTypeEnum = row["LogTypeEnum"].ToString();
                }
                if (row["CreateUser"] != null)
                {
                    log.CreateUser = row["CreateUser"].ToString();
                }
                if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != ""))
                {
                    log.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
                }
                if (row["LogRemark"] != null)
                {
                    log.LogRemark = row["LogRemark"].ToString();
                }
            }
            return(log);
        }
Ejemplo n.º 3
0
        public List <Model_BookProductionLog> DataTableToList(DataTable dt)
        {
            List <Model_BookProductionLog> list = new List <Model_BookProductionLog>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    Model_BookProductionLog item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Ejemplo n.º 4
0
        public bool Add(Model_BookProductionLog model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into BookProductionLog(");
            builder.Append("BookProductionLog_Id,BookId,ResourceToResourceFolder_Id,ParticularYear,Resource_Type,LogTypeEnum,CreateUser,CreateTime,LogRemark)");
            builder.Append(" values (");
            builder.Append("@BookProductionLog_Id,@BookId,@ResourceToResourceFolder_Id,@ParticularYear,@Resource_Type,@LogTypeEnum,@CreateUser,@CreateTime,@LogRemark)");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@BookProductionLog_Id", SqlDbType.Char, 0x24), new SqlParameter("@BookId", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@ParticularYear", SqlDbType.Int, 4), new SqlParameter("@Resource_Type", SqlDbType.Char, 0x24), new SqlParameter("@LogTypeEnum", SqlDbType.Char, 1), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@LogRemark", SqlDbType.NVarChar, 200) };
            cmdParms[0].Value = model.BookProductionLog_Id;
            cmdParms[1].Value = model.BookId;
            cmdParms[2].Value = model.ResourceToResourceFolder_Id;
            cmdParms[3].Value = model.ParticularYear;
            cmdParms[4].Value = model.Resource_Type;
            cmdParms[5].Value = model.LogTypeEnum;
            cmdParms[6].Value = model.CreateUser;
            cmdParms[7].Value = model.CreateTime;
            cmdParms[8].Value = model.LogRemark;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Ejemplo n.º 5
0
 public int ClientUploadTestPaperUpdate(Model_Resource modelResoucrce, Model_ResourceToResourceFolder modelRTRFolder, Model_ResourceToResourceFolder_Property modelRTRFPropety, List <Model_TestQuestions> listModelTQ, List <Model_TestQuestions_Score> listModelTQScore, List <Model_TestQuestions_Option> listModelTQOption, Model_BookProductionLog modelBPL)
 {
     return(this.dal.ClientUploadTestPaperUpdate(modelResoucrce, modelRTRFolder, modelRTRFPropety, listModelTQ, listModelTQScore, listModelTQOption, modelBPL));
 }
Ejemplo n.º 6
0
 public int ClientUploadScienceWord(Model_Resource modelResoucrce, Model_ResourceToResourceFolder modelRTRFolder, List <Model_ResourceToResourceFolder_img> listModelRTRF_img, Model_BookProductionLog modelBPL)
 {
     return(this.dal.ClientUploadScienceWord(modelResoucrce, modelRTRFolder, listModelRTRF_img, modelBPL));
 }
        public int UpdateRTRFAddListData(Model_ResourceToResourceFolder modelRTRF, List <Model_ResourceToResourceFolder_img> list, Model_BookProductionLog modelBPL)
        {
            Dictionary <string, SqlParameter[]> dictionary = new Dictionary <string, SqlParameter[]>();
            StringBuilder builder = new StringBuilder();

            builder = new StringBuilder();
            builder.Append("update ResourceToResourceFolder set ");
            builder.Append("ResourceFolder_Id=@ResourceFolder_Id,");
            builder.Append("Resource_Id=@Resource_Id,");
            builder.Append("File_Name=@File_Name,");
            builder.Append("Resource_Type=@Resource_Type,");
            builder.Append("Resource_Name=@Resource_Name,");
            builder.Append("Resource_Class=@Resource_Class,");
            builder.Append("Resource_Version=@Resource_Version,");
            builder.Append("File_Owner=@File_Owner,");
            builder.Append("CreateFUser=@CreateFUser,");
            builder.Append("CreateTime=@CreateTime,");
            builder.Append("UpdateTime=@UpdateTime,");
            builder.Append("File_Suffix=@File_Suffix,");
            builder.Append("LessonPlan_Type=@LessonPlan_Type,");
            builder.Append("GradeTerm=@GradeTerm,");
            builder.Append("Subject=@Subject,");
            builder.Append("Resource_Domain=@Resource_Domain,");
            builder.Append("Resource_Url=@Resource_Url,");
            builder.Append("Resource_shared=@Resource_shared,");
            builder.Append("Book_ID=@Book_ID,");
            builder.Append("ParticularYear=@ParticularYear");
            builder.Append(" where ResourceToResourceFolder_Id=@ResourceToResourceFolder_Id ");
            SqlParameter[] parameterArray = new SqlParameter[] {
                new SqlParameter("@ResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Id", SqlDbType.Char, 0x24), new SqlParameter("@File_Name", SqlDbType.NVarChar, 250), new SqlParameter("@Resource_Type", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Name", SqlDbType.NVarChar, 250), new SqlParameter("@Resource_Class", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Version", SqlDbType.Char, 0x24), new SqlParameter("@File_Owner", SqlDbType.Char, 0x24), new SqlParameter("@CreateFUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@File_Suffix", SqlDbType.VarChar, 10), new SqlParameter("@LessonPlan_Type", SqlDbType.Char, 0x24), new SqlParameter("@GradeTerm", SqlDbType.Char, 0x24), new SqlParameter("@Subject", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Domain", SqlDbType.NVarChar, 100),
                new SqlParameter("@Resource_Url", SqlDbType.VarChar, 500), new SqlParameter("@Resource_shared", SqlDbType.VarChar, 10), new SqlParameter("@Book_ID", SqlDbType.Char, 0x24), new SqlParameter("@ParticularYear", SqlDbType.Int, 4), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24)
            };
            parameterArray[0].Value    = modelRTRF.ResourceFolder_Id;
            parameterArray[1].Value    = modelRTRF.Resource_Id;
            parameterArray[2].Value    = modelRTRF.File_Name;
            parameterArray[3].Value    = modelRTRF.Resource_Type;
            parameterArray[4].Value    = modelRTRF.Resource_Name;
            parameterArray[5].Value    = modelRTRF.Resource_Class;
            parameterArray[6].Value    = modelRTRF.Resource_Version;
            parameterArray[7].Value    = modelRTRF.File_Owner;
            parameterArray[8].Value    = modelRTRF.CreateFUser;
            parameterArray[9].Value    = modelRTRF.CreateTime;
            parameterArray[10].Value   = modelRTRF.UpdateTime;
            parameterArray[11].Value   = modelRTRF.File_Suffix;
            parameterArray[12].Value   = modelRTRF.LessonPlan_Type;
            parameterArray[13].Value   = modelRTRF.GradeTerm;
            parameterArray[14].Value   = modelRTRF.Subject;
            parameterArray[15].Value   = modelRTRF.Resource_Domain;
            parameterArray[0x10].Value = modelRTRF.Resource_Url;
            parameterArray[0x11].Value = modelRTRF.Resource_shared;
            parameterArray[0x12].Value = modelRTRF.Book_ID;
            parameterArray[0x13].Value = modelRTRF.ParticularYear;
            parameterArray[20].Value   = modelRTRF.ResourceToResourceFolder_Id;
            dictionary.Add(builder.ToString(), parameterArray);
            builder = new StringBuilder();
            builder.Append("delete from ResourceToResourceFolder_img where ResourceToResourceFolder_id=@ResourceToResourceFolder_id ");
            SqlParameter[] parameterArray2 = new SqlParameter[] { new SqlParameter("@ResourceToResourceFolder_id", modelRTRF.ResourceToResourceFolder_Id) };
            dictionary.Add(builder.ToString(), parameterArray2);
            int num = 0;

            foreach (Model_ResourceToResourceFolder_img _img in list)
            {
                num++;
                builder = new StringBuilder();
                builder.AppendFormat("select {0};", num);
                builder.Append("insert into ResourceToResourceFolder_img(");
                builder.Append("ResourceToResourceFolder_img_id,ResourceToResourceFolder_id,ResourceToResourceFolderImg_Url,ResourceToResourceFolderImg_Order,CreateTime)");
                builder.Append(" values (");
                builder.Append("@ResourceToResourceFolder_img_id,@ResourceToResourceFolder_id,@ResourceToResourceFolderImg_Url,@ResourceToResourceFolderImg_Order,@CreateTime)");
                SqlParameter[] parameterArray3 = new SqlParameter[] { new SqlParameter("@ResourceToResourceFolder_img_id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolderImg_Url", SqlDbType.VarChar, 500), new SqlParameter("@ResourceToResourceFolderImg_Order", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime) };
                parameterArray3[0].Value = _img.ResourceToResourceFolder_img_id;
                parameterArray3[1].Value = _img.ResourceToResourceFolder_id;
                parameterArray3[2].Value = _img.ResourceToResourceFolderImg_Url;
                parameterArray3[3].Value = _img.ResourceToResourceFolderImg_Order;
                parameterArray3[4].Value = _img.CreateTime;
                dictionary.Add(builder.ToString(), parameterArray3);
            }
            builder = new StringBuilder();
            builder.Append("insert into BookProductionLog(");
            builder.Append("BookProductionLog_Id,BookId,ResourceToResourceFolder_Id,ParticularYear,Resource_Type,LogTypeEnum,CreateUser,CreateTime,LogRemark)");
            builder.Append(" values (");
            builder.Append("@BookProductionLog_Id,@BookId,@ResourceToResourceFolder_Id,@ParticularYear,@Resource_Type,@LogTypeEnum,@CreateUser,@CreateTime,@LogRemark)");
            SqlParameter[] parameterArray4 = new SqlParameter[] { new SqlParameter("@BookProductionLog_Id", SqlDbType.Char, 0x24), new SqlParameter("@BookId", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@ParticularYear", SqlDbType.Int, 4), new SqlParameter("@Resource_Type", SqlDbType.Char, 0x24), new SqlParameter("@LogTypeEnum", SqlDbType.Char, 1), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@LogRemark", SqlDbType.NVarChar, 200) };
            parameterArray4[0].Value = modelBPL.BookProductionLog_Id;
            parameterArray4[1].Value = modelBPL.BookId;
            parameterArray4[2].Value = modelBPL.ResourceToResourceFolder_Id;
            parameterArray4[3].Value = modelBPL.ParticularYear;
            parameterArray4[4].Value = modelBPL.Resource_Type;
            parameterArray4[5].Value = modelBPL.LogTypeEnum;
            parameterArray4[6].Value = modelBPL.CreateUser;
            parameterArray4[7].Value = modelBPL.CreateTime;
            parameterArray4[8].Value = modelBPL.LogRemark;
            dictionary.Add(builder.ToString(), parameterArray4);
            object obj2 = DbHelperSQL.ExecuteSqlTran(dictionary);

            if (obj2 == null)
            {
                return(0);
            }
            return(Convert.ToInt32(obj2));
        }
Ejemplo n.º 8
0
 public bool Add(Model_BookProductionLog model)
 {
     return(this.dal.Add(model));
 }
Ejemplo n.º 9
0
 public bool Update(Model_BookProductionLog model)
 {
     return(this.dal.Update(model));
 }
 public int UpdateRTRFAddListData(Model_ResourceToResourceFolder modelRTRF, List <Model_ResourceToResourceFolder_img> list, Model_BookProductionLog modelBPL)
 {
     return(this.dal.UpdateRTRFAddListData(modelRTRF, list, modelBPL));
 }