/// <summary>
 /// 添加WLOGMission表行数据(如主键为非自增型字段,则自行修改代码)
 /// </summary>
 /// <param name="wlogmissiondata">数据集对象</param>
 /// <param name="wlogmission">实体对象</param>
 public void AddRow(ref WLOGMissionData wlogmissiondata, EntityWLOGMission wlogmission)
 {
     #region
     DataRow dr = wlogmissiondata.Tables[0].NewRow();
     wlogmission.missionId = this._wlogmissionclass.GetMaxAddOne(wlogmissiondata).ToString();
     wlogmissiondata.Assign(dr, WLOGMissionData.missionId, wlogmission.missionId);
     wlogmissiondata.Assign(dr, WLOGMissionData.summaryId, wlogmission.summaryId);
     wlogmissiondata.Assign(dr, WLOGMissionData.writeUser, wlogmission.writeUser);
     wlogmissiondata.Assign(dr, WLOGMissionData.projectId, wlogmission.projectId);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionBH, wlogmission.missionBH);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionName, wlogmission.missionName);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionRemark, wlogmission.missionRemark);
     wlogmissiondata.Assign(dr, WLOGMissionData.planned, wlogmission.planned);
     wlogmissiondata.Assign(dr, WLOGMissionData.plantimelimit, wlogmission.plantimelimit);
     wlogmissiondata.Assign(dr, WLOGMissionData.outputResult, wlogmission.outputResult);
     wlogmissiondata.Assign(dr, WLOGMissionData.startDate, wlogmission.startDate);
     wlogmissiondata.Assign(dr, WLOGMissionData.reviewState, wlogmission.reviewState);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionState, wlogmission.missionState);
     wlogmissiondata.Assign(dr, WLOGMissionData.deleted, wlogmission.deleted);
     wlogmissiondata.Assign(dr, WLOGMissionData.usable, wlogmission.usable);
     wlogmissiondata.Assign(dr, WLOGMissionData.updated, wlogmission.updated);
     wlogmissiondata.Assign(dr, WLOGMissionData.deleteTime, wlogmission.deleteTime);
     wlogmissiondata.Assign(dr, WLOGMissionData.writeTime, wlogmission.writeTime);
     wlogmissiondata.Assign(dr, WLOGMissionData.writeIp, wlogmission.writeIp);
     wlogmissiondata.Tables[0].Rows.Add(dr);
     #endregion
 }
        public string GetMissionsIdBySummaryId(EntityWLOGMission mission)
        {
            #region
            DBConditions querybusinessparams = new DBConditions();
            querybusinessparams.Add(WLOGMissionData.writeUser, EnumSqlType.sqlint, EnumCondition.Equal, mission.writeUser);
            querybusinessparams.Add(WLOGMissionData.summaryId, EnumSqlType.sqlint, EnumCondition.Equal, mission.summaryId);
            WLOGMissionData missiondata = new WLOGMissionData();
            this._wlogmissionclass.GetSingleT(missiondata, querybusinessparams);

            JsonHelper        jsonhlp    = new JsonHelper();
            string            missionsid = "";
            DataRowCollection drcollect  = missiondata.Tables[0].Rows;
            for (int i = 0; i < drcollect.Count; i++)
            {
                string temp = drcollect[i][WLOGMissionData.missionId].ToString();
                if (i != drcollect.Count - 1)
                {
                    temp += ',';
                }
                missionsid += temp;
            }
            jsonhlp.AddObjectToJson("missionId", missionsid);
            jsonhlp.SetResult(true);
            return(jsonhlp.ToString());

            #endregion
        }
        public string UpdateMissionSummaryId(string oldMisssionsId, string newMissionsId, string summaryId)
        {
            #region
            int          totalCount          = 0;
            PageParams   pageparams          = new PageParams();
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Or(WLOGMissionData.missionId, EnumSqlType.sqlint, EnumCondition.InValues, oldMisssionsId);
            querybusinessparams.Or(WLOGMissionData.missionId, EnumSqlType.sqlint, EnumCondition.InValues, newMissionsId);
            WLOGMissionData missiondata = new WLOGMissionData();
            totalCount = this._wlogmissionclass.GetSingleT(missiondata, querybusinessparams);

            string[] oldmissionid = oldMisssionsId.Split(',');
            string[] newmissionid = newMissionsId.Split(',');
            DataRow  dr;
            for (int i = 0; i < oldmissionid.Length; i++)
            {
                if (oldmissionid[i] != "")
                {
                    dr = missiondata.Tables[0].Rows.Find(oldmissionid[i]);
                    missiondata.Assign(dr, WLOGMissionData.summaryId, "");
                }
            }
            for (int i = 0; i < newmissionid.Length; i++)
            {
                if (newmissionid[i] != "")
                {
                    dr = missiondata.Tables[0].Rows.Find(newmissionid[i]);
                    missiondata.Assign(dr, WLOGMissionData.summaryId, summaryId);
                }
            }

            return(this.SaveWLOGMission(missiondata));

            #endregion
        }
 /// <summary>
 /// 编辑wlogmissiondata数据集中指定的行数据
 /// </summary>
 /// <param name="wlogmissiondata">数据集对象</param>
 /// <param name="wlogmission">实体对象</param>
 public void EditRow(ref WLOGMissionData wlogmissiondata, EntityWLOGMission wlogmission)
 {
     #region
     if (wlogmissiondata.Tables[0].Rows.Count <= 0)
     {
         wlogmissiondata = this.getData(wlogmission.missionId);
     }
     DataRow dr = wlogmissiondata.Tables[0].Rows.Find(new object[1] {
         wlogmission.missionId
     });
     wlogmissiondata.Assign(dr, WLOGMissionData.missionId, wlogmission.missionId);
     wlogmissiondata.Assign(dr, WLOGMissionData.summaryId, wlogmission.summaryId);
     wlogmissiondata.Assign(dr, WLOGMissionData.writeUser, wlogmission.writeUser);
     wlogmissiondata.Assign(dr, WLOGMissionData.projectId, wlogmission.projectId);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionBH, wlogmission.missionBH);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionName, wlogmission.missionName);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionRemark, wlogmission.missionRemark);
     wlogmissiondata.Assign(dr, WLOGMissionData.planned, wlogmission.planned);
     wlogmissiondata.Assign(dr, WLOGMissionData.plantimelimit, wlogmission.plantimelimit);
     wlogmissiondata.Assign(dr, WLOGMissionData.outputResult, wlogmission.outputResult);
     wlogmissiondata.Assign(dr, WLOGMissionData.startDate, wlogmission.startDate);
     wlogmissiondata.Assign(dr, WLOGMissionData.reviewState, wlogmission.reviewState);
     wlogmissiondata.Assign(dr, WLOGMissionData.missionState, wlogmission.missionState);
     wlogmissiondata.Assign(dr, WLOGMissionData.deleted, wlogmission.deleted);
     wlogmissiondata.Assign(dr, WLOGMissionData.usable, wlogmission.usable);
     wlogmissiondata.Assign(dr, WLOGMissionData.updated, wlogmission.updated);
     wlogmissiondata.Assign(dr, WLOGMissionData.deleteTime, wlogmission.deleteTime);
     wlogmissiondata.Assign(dr, WLOGMissionData.writeTime, wlogmission.writeTime);
     wlogmissiondata.Assign(dr, WLOGMissionData.writeIp, wlogmission.writeIp);
     #endregion
 }
        /// <summary>
        /// 保存wlogmissiondata数据集数据
        /// </summary>
        /// <param name="wlogmissiondata">数据集对象</param>
        /// <returns>返回保存后的响应信息</returns>
        public String SaveWLOGMission(WLOGMissionData wlogmissiondata)
        {
            #region
            WLOGMissionClass wlogmissionclass = new WLOGMissionClass();
            return(base.Save(wlogmissiondata, this._wlogmissionclass));

            #endregion
        }
        /// <summary>
        /// 获取WLOGMission数据表的全部数据
        /// </summary>
        /// <returns>Json字符串</returns>
        public string GetJsonByAll()
        {
            #region
            int             totalCount      = 0;
            WLOGMissionData wlogmissiondata = this.getData(null);
            totalCount = wlogmissiondata.Tables[0].Rows.Count;
            return(base.GetJson(wlogmissiondata, totalCount));

            #endregion
        }
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="missionId">主键-任务项流水号</param>
        /// <returns></returns>
        private WLOGMissionData getData(string missionId)
        {
            #region
            WLOGMissionData wlogmissiondata     = new WLOGMissionData();
            DBConditions    querybusinessparams = new DBConditions();
            querybusinessparams.Add(WLOGMissionData.missionId, EnumSqlType.sqlint, EnumCondition.Equal, missionId);
            this._wlogmissionclass.GetSingleTAllWithoutCount(wlogmissiondata, querybusinessparams);
            return(wlogmissiondata);

            #endregion
        }
        /****************************************
         ***生成器版本:V1.0.1.31494
         ***生成时间:2013-04-24 18:44:01
         ***公司:山西ICat Studio有限公司
         ***友情提示:以下代码为生成器自动生成,可做参照复制之用;
         ***         如需有其他业务要求,则可在region外添加新的业务关联方法;
         ***         如发现任何编译错误,请联系QQ:330669393。
         *****************************************/
        /// <summary>
        /// 检索数据并分页返回数据集
        /// </summary>
        /// <param name="recordCount">符合条件的总记录数</param>
        /// <param name="qParams">分页对象</param>
        /// <param name="conditions">查询条件集合</param>
        /// <returns>分页数据</returns>
        public int SelectWLOGMissionByPage(WLOGMissionData wlogmissiondata, DBConditions conditions)
        {
            #region
            string sqlformat   = @"SELECT {0} FROM [WLOGMission] a 
                                         left join 
                                              (select count(logId) as personlogcount,missionid from dbo.WLOGPersonLog group by missionid) b 
                                                      on a.missionid = b.missionid";
            string businesssql = string.Format(sqlformat, "a.*, b.personlogcount");
            string countsql    = string.Format(sqlformat, "count(*)");
            conditions.AddKeys(WLOGMissionData.missionId);
            return(base.GetCustomBusiness(businesssql, countsql, wlogmissiondata, conditions));

            #endregion
        }
 /// <summary>
 /// 删除wlogmissiondata数据集中指定的行数据
 /// </summary>
 /// <param name="wlogmissiondata">数据集对象</param>
 /// <param name="missionId">主键-任务项流水号</param>
 public void DeleteRow(ref WLOGMissionData wlogmissiondata, string missionId)
 {
     #region
     if (wlogmissiondata.Tables[0].Rows.Count <= 0)
     {
         wlogmissiondata = this.getData(missionId);
     }
     DataRow dr = wlogmissiondata.Tables[0].Rows.Find(new object[1] {
         missionId
     });
     if (dr != null)
     {
         dr.Delete();
     }
     #endregion
 }
Exemple #10
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="summaryData"></param>
 /// <param name="missionData"></param>
 /// <param name="personlogData"></param>
 /// <param name="fullname"></param>
 public ExcelSummary(string filename, WLOGWeekSummaryData summaryData
                     , WLOGMissionData missionData, WLOGPersonLogData personlogData, string fullname)
 {
     #region
     this.filename      = filename;
     this.summaryData   = summaryData;
     this.missionData   = missionData;
     this.personlogData = personlogData;
     this.titleStyle    = new CellsStyle(StyleType.title);
     this.contentStyle  = new CellsStyle(StyleType.content);
     this.titleChildren = new CellsStyle(StyleType.titlechildren);
     this.titleInleft   = new CellsStyle(StyleType.titleInLeft);
     this.logsFullname  = fullname;
     this.createWorkState();
     #endregion
 }
Exemple #11
0
        /// <summary>
        /// 导出工作总结。
        /// </summary>
        /// <param name="summaryId"></param>
        /// <param name="summaryExcelWriteUser"></param>
        public void OutputSummaryExcel(string summaryId, string summaryExcelWriteUser)
        {
            #region
            WLOGWeekSummaryData weeksummarydata     = this.getData(summaryId);
            PageParams          pageparams          = new PageParams();
            WLOGWeekSummaryData wlogweeksummarydata = new WLOGWeekSummaryData();
            DBConditions        querybusinessparams = new DBConditions(pageparams);

            querybusinessparams.Add(WLOGMissionData.summaryId,
                                    EnumSqlType.sqlint, EnumCondition.Equal, summaryId);
            WLOGMissionData missiondata = new WLOGMissionData();
            this._wlogweeksummaryclass.GetSingleT(missiondata, querybusinessparams);

            string            missionsid = "";
            DataRowCollection drcollect  = missiondata.Tables[0].Rows;
            for (int i = 0; i < drcollect.Count; i++)
            {
                string temp = drcollect[i][WLOGMissionData.missionId].ToString();
                if (i != drcollect.Count - 1)
                {
                    temp += ',';
                }
                missionsid += temp;
            }

            DataRow      drsummary = weeksummarydata.Tables[0].Rows[0];
            DBConditions personlogquerybusinessparams = new DBConditions();
            personlogquerybusinessparams.Add(WLOGPersonLogData.writeUser, EnumSqlType.sqlint, EnumCondition.Equal, drsummary[WLOGWeekSummaryData.writeUser]);
            personlogquerybusinessparams.Add(WLOGPersonLogData.logDate, EnumSqlType.datetime, EnumCondition.GreaterOrEqual, drsummary[WLOGWeekSummaryData.startDate]);
            personlogquerybusinessparams.Add(WLOGPersonLogData.logDate, EnumSqlType.datetime, EnumCondition.LessOrEqual, drsummary[WLOGWeekSummaryData.endDate]);
            WLOGPersonLogData wlogpersonlogdata = new WLOGPersonLogData();
            this._wlogweeksummaryclass.GetSingleT(wlogpersonlogdata, personlogquerybusinessparams);

            ExcelSummary excelsummary = new ExcelSummary(this.getFilename(weeksummarydata, summaryExcelWriteUser), weeksummarydata, missiondata, wlogpersonlogdata, summaryExcelWriteUser);
            excelsummary.Output();
            #endregion
        }
        public string GetMissionBySummaryId(EntityWLOGMission mission, SceneWeekSummary scene)
        {
            #region
            WLOGMissionClass wlogmissionclass    = new WLOGMissionClass();
            DBConditions     querybusinessparams = new DBConditions();
            querybusinessparams.Add(WLOGMissionData.writeUser, EnumSqlType.sqlint, EnumCondition.Equal, mission.writeUser);
            switch (scene)
            {
            case SceneWeekSummary.ViewMissions:
                querybusinessparams.Or(WLOGMissionData.summaryId,
                                       EnumSqlType.sqlint, EnumCondition.Equal, mission.summaryId);
                break;

            case SceneWeekSummary.AddWeekSummary:
                querybusinessparams.Or(WLOGMissionData.summaryId,
                                       EnumSqlType.sqlint, EnumCondition.EmptyIsNull, "");
                break;

            case SceneWeekSummary.EditWeekSummary:
                querybusinessparams.Or(WLOGMissionData.summaryId,
                                       EnumSqlType.sqlint, EnumCondition.EmptyIsNull, "");
                querybusinessparams.Add(WLOGMissionData.summaryId,
                                        EnumSqlType.sqlint, EnumCondition.Equal, mission.summaryId);
                querybusinessparams.Add(WLOGMissionData.writeUser,
                                        EnumSqlType.sqlint, EnumCondition.Equal, mission.writeUser);
                break;

            default:
                break;
            }
            int             totalCount  = 0;
            WLOGMissionData missiondata = new WLOGMissionData();
            totalCount = this._wlogmissionclass.GetSingleT(missiondata, querybusinessparams);
            return(base.GetJson(missiondata, totalCount));

            #endregion
        }
        /// <summary>
        /// 根据条件筛选所有WLOGMission指定页码的数据(分页型)
        /// </summary>
        /// <param name="wlogmission">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public DataSet GetData(EntityWLOGMission wlogmission, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(WLOGMissionData.writeUser, EnumSqlType.sqlint,
                                    EnumCondition.Equal, wlogmission.writeUser);
            querybusinessparams.Add(WLOGMissionData.missionBH, EnumSqlType.nvarchar,
                                    EnumCondition.LikeRight, wlogmission.missionBH);
            querybusinessparams.Add(WLOGMissionData.missionName, EnumSqlType.nvarchar,
                                    EnumCondition.LikeBoth, wlogmission.missionName);
            querybusinessparams.Add(WLOGMissionData.planned, EnumSqlType.bit,
                                    EnumCondition.Equal, wlogmission.planned);
            querybusinessparams.Add(WLOGMissionData.reviewState, EnumSqlType.bit,
                                    EnumCondition.Equal, wlogmission.reviewState);
            querybusinessparams.Add(WLOGMissionData.missionState, EnumSqlType.tinyint,
                                    EnumCondition.Equal, wlogmission.missionState);
            querybusinessparams.Add(WLOGMissionData.usable, EnumSqlType.bit,
                                    EnumCondition.Equal, wlogmission.usable);
            WLOGMissionData wlogmissiondata = new WLOGMissionData();
            totalCount = this._wlogmissionclass.SelectWLOGMissionByPage(wlogmissiondata, querybusinessparams);
            return(wlogmissiondata);

            #endregion
        }