/// <summary> /// 得到一个对象实体 /// </summary> public FYSOFT.HMIS.Models.User GetModel(String UserID) { FYSOFT.HMIS.Models.User model = new FYSOFT.HMIS.Models.User(); DataSet ds = DbHelperOLE.Query(UserSQLS.Select1String(UserID)); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["userid"] != null && ds.Tables[0].Rows[0]["userid"].ToString() != "") { model.UserID = ds.Tables[0].Rows[0]["userid"].ToString(); } if (ds.Tables[0].Rows[0]["username"] != null && ds.Tables[0].Rows[0]["username"].ToString() != "") { model.UserName = ds.Tables[0].Rows[0]["username"].ToString(); } if (ds.Tables[0].Rows[0]["userpassword"] != null && ds.Tables[0].Rows[0]["userpassword"].ToString() != "") { model.UserPassword = ds.Tables[0].Rows[0]["userpassword"].ToString(); } return(model); } else { return(null); } }
/// <summary> /// 周状态报表 /// </summary> /// <param name="year"></param> /// <param name="month"></param> /// <param name="week"></param> /// <returns></returns> public DataSet GetWeekStatueReport(int year, int month, int week) { DataSet ds = new DataSet(); //项目信息 string strSql = string.Format(@"select c.contractno,c.custmanager,p.projectname,c.department,sp.subprojecttype,sp.implementationamount ,p.implementdepartment,p.projectmanager,sp.earlypercentage,progress,'' as jieduandate,sp.totalschedule ,(select sc.contractamount*(sp.totalschedule- sp.earlypercentage)/100 ) as totalreceive,sp.subprojectid from t_Contract c left join t_SubContract sc on c.contractid=sc.contractid left join t_Project p on p.subcontractid=sc.subcontractid left join t_SubProject sp on sp.projectid=p.projectid where p.projectid is not null or sp.subprojectid is not null", year); DataTable dt = DbHelperOLE.Query(strSql).Tables[0].Copy(); dt.TableName = "maintable"; ds.Tables.Add(dt); //状态信息 strSql = string.Format(@"select p.subprojectid,pp.month,pp.weektime,pp.week,pp.milestone,pp.percentage ,(SELECT ISNULL(percentage,0)*(select implementationamount from t_SubProject where subprojectid=(SELECT subprojectid FROM t_ProjectWeekStatus where statusid=pp.statusid))/100 ) as smoney from t_ProjectWeekStatus p left join t_ProjectPlan pp on p.statusid=pp.statusid where p.year={0} and p.moth={1} and p.week={2} order by pp.month,pp.week", year, month, week); DataTable dt2 = DbHelperOLE.Query(strSql).Tables[0].Copy(); dt2.TableName = "subtable"; ds.Tables.Add(dt2); return(ds); }
/// <summary> /// 人天报表 /// </summary> /// <returns></returns> public DataSet GetPeopleDayReport() { string srrSQL = @"select c.contractno,sp.subprojectname,sp.subprojectmanager,sp.subprojecttype,sp.implementationamount,p.implementdepartment,sp.subprojectmanager,sp.planpeopledays,(SELECT SUM(actualdays) FROM t_Actualdays where subprojectid=sp.subprojectid) as actualday from t_Contract c left join t_SubContract sc on c.contractid=sc.contractid left join t_Project p on p.subcontractid=sc.subcontractid left join t_SubProject sp on sp.projectid=p.projectid where sp.subprojectid is not null"; return(DbHelperOLE.Query(srrSQL)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(FYSOFT.HMIS.Models.Dictionary model) { object obj = DbHelperOLE.ExecuteSql(DictionarySQLS.InsertString(model)); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 里程碑报表 /// </summary> /// <returns></returns> public DataSet GetMileStoneReport() { string srrSQL = @"select c.contractno,sp.subprojectname,sp.subprojectmanager,sp.subprojecttype,sm.milestonename ,CONVERT(NVARCHAR,sm.startdate,23) as startdate, CONVERT(NVARCHAR,sm.planfinishdate,23) as planfinishdate,CONVERT(NVARCHAR,sm.finishdate,23) as finishdate from t_Contract c left join t_SubContract sc on c.contractid=sc.contractid left join t_Project p on p.subcontractid=sc.subcontractid left join t_SubProject sp on sp.projectid=p.projectid left join t_Milestone m on sp.subprojectid=m.subprojectid left join t_MilestoneSub sm on sm.milestoneid=m.milestoneid where sp.subprojectid is not null "; return(DbHelperOLE.Query(srrSQL)); }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(string UserID) { int rows = DbHelperOLE.ExecuteSql(UserSQLS.DeleteString(UserID)); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(FYSOFT.HMIS.Models.User model) { int rows = DbHelperOLE.ExecuteSql(UserSQLS.UpdateString(model)); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 用户名 /// </summary> public bool CheckUserName(string UserName) { try { int i = Convert.ToInt32(DbHelperOLE.Query(UserSQLS.SelectCountByUserNameString(UserName)).Tables[0].Rows[0][0]); if (i > 0) { return(false); } else { return(true); } } catch { return(false); } }
/// <summary> /// 修改用户密码 /// </summary> public bool UpdateUserPassword(string UserName, string UserPasswword) { string Sql = string.Format(UserSQLS.UpdateByUserNamePassWord(UserName, UserPasswword)); try { if (DbHelperOLE.ExecuteSql(Sql) > 0) { return(true); } else { return(false); } } catch { return(false); } }
/// <summary> /// 根据类别获取字典列表 /// </summary> /// <returns></returns> public DataSet GetDictTableByTypeName(String DictionaryName) { return(DbHelperOLE.Query(DictionarySQLS.GetDictTableByTypeName(DictionaryName))); }
/// <summary> /// 获得数据列表 /// </summary> public DataSet GetList(string strWhere) { return(DbHelperOLE.Query(UserSQLS.SelectMuiltString(strWhere))); }