本文整理汇总了C#中GetDataModel类的典型用法代码示例。如果您正苦于以下问题:C# GetDataModel类的具体用法?C# GetDataModel怎么用?C# GetDataModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GetDataModel类属于命名空间,在下文中一共展示了GetDataModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetData
public object GetData(string userid, string caseId)
{
try
{
GetDataModel dataModel = new GetDataModel();
B_OA_Notice en = new B_OA_Notice();
en.Condition.Add("caseid=" + caseId);
dataModel.baseInfor_Notice = Utility.Database.QueryObject<B_OA_Notice>(en);
if (dataModel.baseInfor_Notice == null)
{
//初始化数据
IDbTransaction tran = Utility.Database.BeginDbTransaction();
var baseInfor_Notice = new B_OA_Notice();
baseInfor_Notice.status = "0";
baseInfor_Notice.CreaterId = userid;
var userInfor = ComClass.GetUserInfo(userid);
baseInfor_Notice.CreateMan = userInfor.CnName;
baseInfor_Notice.CreateTime = DateTime.Now.ToString();
baseInfor_Notice.NewsId = ComClass.GetGuid();
baseInfor_Notice.Chk = "0";
B_OA_FileType fileType = ComDocumentCenterOperate.GetFileTypeByFlayType("4", tran);
baseInfor_Notice.documentTypeId = fileType.FileTypeId;
baseInfor_Notice.documentTypeName = ComDocumentCenterOperate.getFileTypeNameByFileTypeId(fileType.FileTypeId, tran);
dataModel.baseInfor_Notice = baseInfor_Notice;
Utility.Database.Commit(tran);
}
return dataModel;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例2: GetData
public object GetData(string userid, string caseId, string baid, string actid)
{
try
{
//只有待办箱才有设置为已读
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
var data = new GetDataModel();
B_OA_LeaveList en = new B_OA_LeaveList();
en.Condition.Add("caseId=" + caseId);
data.baseInfo = Utility.Database.QueryObject<B_OA_LeaveList>(en);
if (data.baseInfo == null)
{
data.baseInfo = new B_OA_LeaveList();
DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(userid);
data.baseInfo.leaveer = userid;
data.baseInfo.leaveName = d_u_Infor.userinfo.CnName;
data.baseInfo.dpname = d_u_Infor.deptinfo.DPName;
}
else
{
data.baseInfo.leaveName = ComClass.GetUserInfo(data.baseInfo.leaveer).CnName;
data.baseInfo.dpname = ComClass.GetDeptByUserId(data.baseInfo.leaveer).FullName;
}
return data;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例3: GetData
public object GetData(string userid, string caseId, string baid, string actid)
{
try
{
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
var data = new GetDataModel();
if (caseId == "")
{
DeptInfoAndUserInfo userData = ComClass.GetDeptAndUserByUserId(userid);
data.sendDocBaseInfo = new B_OA_SendDoc_Inner_QuZhan();
data.sendDocBaseInfo.underTakeManId = userData.userinfo.UserID;
data.sendDocBaseInfo.undertakeMan = userData.userinfo.CnName;
data.sendDocBaseInfo.underTakeDep = userData.deptinfo.DPName;
data.sendDocBaseInfo.underTakeDepId = userData.deptinfo.DPID;
B_OA_FileType fileType = new B_OA_FileType();
fileType.Condition.Add("flagType = " + "3");
fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType);
data.sendDocBaseInfo.fileTypeId = fileType.FileTypeId;
}
else
{
B_OA_SendDoc_Inner_QuZhan userData = new B_OA_SendDoc_Inner_QuZhan();
userData.Condition.Add("caseId=" + caseId);
userData = Utility.Database.QueryObject<B_OA_SendDoc_Inner_QuZhan>(userData);
data.sendDocBaseInfo = userData;
}
return data;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例4: GetData
public object GetData(string userid, string caseId)
{
try
{
GetDataModel dataModel = new GetDataModel();
B_OA_Notice en = new B_OA_Notice();
en.Condition.Add("caseid=" + caseId);
dataModel.baseInfor_Notice = Utility.Database.QueryObject<B_OA_Notice>(en);
if (dataModel.baseInfor_Notice == null)
{
//初始化数据
IDbTransaction tran = Utility.Database.BeginDbTransaction();
var baseInfor_Notice = new B_OA_Notice();
baseInfor_Notice.status = "checkUnthrough";
baseInfor_Notice.CreaterId = userid;
var userInfor = ComClass.GetUserInfo(userid);
baseInfor_Notice.CreateMan = userInfor.CnName;
baseInfor_Notice.CreateTime = DateTime.Now.ToString();
baseInfor_Notice.NewsId = ComClass.GetGuid();
baseInfor_Notice.Chk = "0";
dataModel.baseInfor_Notice = baseInfor_Notice;
Utility.Database.Commit(tran);
}
return Utility.JsonResult(true, null, dataModel);
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例5: GetData
public object GetData(string userid, string caseId, string baid)
{
try
{
//只有待办箱才有设置为已读
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
GetDataModel data = new GetDataModel();
B_OA_SendDoc_Science en = new B_OA_SendDoc_Science();
en.Condition.Add("caseid=" + caseId);
data.sendDocBaseInfo = Utility.Database.QueryObject<B_OA_SendDoc_Science>(en);
if (data.sendDocBaseInfo == null)
{
var baseInfo = new B_OA_SendDoc_Science();
baseInfo.sendDate = DateTime.Now;
baseInfo.createManId = userid;
//baseInfo.gklx = "1";//公开类型默认为主动公开
data.sendDocBaseInfo = baseInfo;
}
return data;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例6: CreateMainBody
public string CreateMainBody(string content, string guid, string caseid, string userid, string type,string actId)
{
IDbTransaction tran = Utility.Database.BeginDbTransaction();
GetDataModel dataModel = new GetDataModel();
try
{
string id = "";
if (String.IsNullOrEmpty(caseid))
{
id = guid;
}
else
{
id = caseid;
}
//正文路径
string path = GetFilePath("mainbody", id, userid, tran, type, actId);
dataModel.mainBodyPath = path;
Utility.Database.Commit(tran);
return Utility.JsonResult(true, "发送成功!", dataModel);
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("读取正文模版失败!", ex));
}
}
示例7: GetUserInforList
public string GetUserInforList(string userid)
{
var tran = Utility.Database.BeginDbTransaction();
GetDataModel dataModel = new GetDataModel();
try
{
StringBuilder strSql = new StringBuilder();
strSql.Append(@"
SELECT
a.UserID,
a.CnName,
a.SEX,
a.DPID,
a.JobPosition,
a.EntryTime,
b.DPName
FROM
FX_UserInfo AS a
LEFT JOIN FX_Department AS b ON a.DPID = b.DPID
ORDER BY
UserID DESC
");
DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(),tran);
dataModel.dt = ds.Tables[0];
Utility.Database.Commit(tran);
return JsonConvert.SerializeObject(dataModel);//将对象转为json字符串并返回到客户端
}
catch (Exception ex)
{
ComBase.Logger(ex);//写异常日志到本地文件夹
return Utility.JsonMsg(false, ex.Message);//将对象转为json字符串并返回到客户端
}
return "";
}
示例8: GetData
public string GetData(string userid)
{
GetDataModel dataModel = new GetDataModel();
try
{
StringBuilder strSql = new StringBuilder();
strSql.Append(string.Format(@"SELECT TOP 1
ISNULL(PunchID,0) AS PunchID , UserID, PunchDate, CONVERT(VARCHAR(20),ToWorkTime,120) AS ToWorkTime,
CONVERT(VARCHAR(20),DownWorkTime,120) AS DownWorkTime, Remark,SUBSTRING(CONVERT(VARCHAR(20),B.StartTime,120),11,6) AS StartTime,SUBSTRING(CONVERT(VARCHAR(20),B.EndTime,120),11,6) AS EndTime,
A.WorkingDayID, WorkingDayName, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, BeginExecuteDay
FROM B_OA_WorkingDay A
LEFT JOIN B_OA_WorkingTimes B ON A.WorkingDayID = B.WorkingDayID
LEFT JOIN B_OA_Punch C ON C.UserID = '{0}' AND (ToWorkTime > CONVERT(VARCHAR(10),GETDATE(),120)OR DownWorkTime > CONVERT(VARCHAR(10),GETDATE(),120)) AND A.WorkingDayID = C.WorkingDayID
ORDER BY A.WorkingDayID DESC
", userid));
DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString());
string jsonData = JsonConvert.SerializeObject(dataSet.Tables[0]);
dataModel.baseInfo = ((List<B_OA_Punch>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_Punch>)))[0];
return JsonConvert.SerializeObject( dataModel);
}
catch (Exception ex)
{
return Utility.JsonMsg(false, ex.Message);
}
}
示例9: GetData
public string GetData(string beginTime, string endTime, string name, string userid)
{
IDbTransaction tran = null;
DataSet dataSet = null;
GetDataModel dataModel = new GetDataModel();
try
{
tran = Utility.Database.BeginDbTransaction();
string sql = "select * from B_OA_Attendance where 1=1 ";
if (name != null & name != "") { sql += " and name='{0}' "; sql = string.Format(sql, name); }
if (beginTime != null & beginTime != "") { sql += " and WorkDate>='{0}'"; sql = string.Format(sql, beginTime); }
if (endTime != null & endTime != "") { sql += " and WorkDate<='{0}'"; sql = string.Format(sql, endTime); }
sql += " order by WorkDate desc ";
dataSet = Utility.Database.ExcuteDataSet(sql, tran);
string jsonData = JsonConvert.SerializeObject(dataSet.Tables[0]);
List<B_OA_Attendance> listAttentdance = (List<B_OA_Attendance>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_Attendance>));
dataModel.listAttendance = new List<B_OA_Attendance>();
dataModel.listAttendance = listAttentdance;
Utility.Database.Commit(tran);//提交事务
return JsonConvert.SerializeObject( dataModel);//将对象转为json字符串并返回到客户端
}
catch (Exception ex)
{
Utility.Database.Rollback(tran);
ComBase.Logger(ex);//写异常日志到本地文件夹
return Utility.JsonMsg(false, ex.Message);//将对象转为json字符串并返回到客户端
}
finally {
dataSet.Dispose();
}
}
示例10: GetData
public string GetData(string userid)
{
StringBuilder strSql = new StringBuilder();
GetDataModel dataModel = new GetDataModel();
strSql.Append(@"SELECT TOP 1
A.WorkingDayID, WorkingDayName, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, CONVERT(VARCHAR(10),BeginExecuteDay,120) AS BeginExecuteDay,
(CASE Monday WHEN 1 THEN '周一' ELSE '' END) +
(CASE WHEN (Tuesday = 1 AND Monday = 0) THEN '周二' WHEN Tuesday = 1 THEN ',周二' ELSE '' END)+
(CASE WHEN (Wednesday = 1 AND Tuesday = 0 AND Monday = 0) THEN '周三' WHEN Wednesday = 1 THEN ',周三' ELSE '' END)+
(CASE WHEN (Thursday = 1 AND Wednesday = 0 AND Tuesday = 0 AND Monday = 0) THEN '周四' WHEN Thursday = 1 THEN ',周四' ELSE '' END)+
(CASE WHEN (Friday = 1 AND Thursday = 0 AND Wednesday = 0 AND Tuesday = 0 AND Monday = 0) THEN '周五' WHEN Friday = 1 THEN ',周五' ELSE '' END)+
(CASE WHEN (Saturday = 1 AND Friday = 0 AND Thursday = 0 AND Wednesday = 0 AND Tuesday = 0 AND Monday = 0) THEN '周六' WHEN Saturday = 1 THEN ',周六' ELSE '' END)+
(CASE Sunday WHEN 1 THEN ',周日' ELSE '' END) AS WorkingDay,
ISNULL(STUFF((SELECT '' + B.WorkingTime FROM
(SELECT WorkingDayID, (SUBSTRING(CONVERT(VARCHAR(20),StartTime,120),11,6) + '~' + SUBSTRING(CONVERT(VARCHAR(20),EndTime,120),11,6)) AS WorkingTime
FROM B_OA_WorkingTimes WHERE WorkingDayID = A.WorkingDayID)B
FOR XML PATH ('')),1,1,''),'') AS WorkingTime,SUBSTRING(CONVERT(VARCHAR(20),B.StartTime,120),11,6) AS StartTime,
SUBSTRING(CONVERT(VARCHAR(20),B.EndTime,120),11,6) AS EndTime
FROM B_OA_WorkingDay A
LEFT JOIN B_OA_WorkingTimes B ON B.WorkingDayID = A.WorkingDayID
ORDER BY A.WorkingDayID DESC");
DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString());
string jsonData = JsonConvert.SerializeObject(dataSet.Tables[0]);
dataModel.dataList = (List<B_OA_WorkingDay>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_WorkingDay>));
return Utility.JsonResult(true, null, dataModel);
}
示例11: GetData
public string GetData(string beginTime, string endTime,string ScheduleType, string userid)
{
//只有待办箱才有设置为已读
//if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
IDbTransaction tran = null;
DataSet dataSet = null;
try
{
tran = Utility.Database.BeginDbTransaction();
GetDataModel data = new GetDataModel();//获取数据模型
data.baseInfo = new B_OA_Schedule();
string sql = "select CONVERT(varchar(20),ScheduleTime,23) as ScheduleTime,* from B_OA_Schedule where 1=1 ";
if (ScheduleType != null & ScheduleType != "") { sql += " and ScheduleType='{0}' "; sql = string.Format(sql, ScheduleType); }
if (beginTime != null & beginTime != "") { sql += " and ScheduleTime>='{0}'"; sql = string.Format(sql, beginTime); }
if (endTime != null & endTime != "") { sql += " and ScheduleTime<='{0}'"; sql = string.Format(sql, endTime); }
sql += " order by B_OA_Schedule.ScheduleTime ";
dataSet = Utility.Database.ExcuteDataSet(sql, tran);
data.List = dataSet.Tables[0];
Utility.Database.Commit(tran);//提交事务
return Utility.JsonResult(true, null, data);//将对象转为json字符串并返回到客户端
}
catch (Exception ex)
{
Utility.Database.Rollback(tran);
ComBase.Logger(ex);//写异常日志到本地文件夹
return Utility.JsonResult(false, ex.Message);//将对象转为json字符串并返回到客户端
}
finally {
dataSet.Dispose();
}
}
示例12: GetData
public object GetData(string userid, string caseId, string baid)
{
//只有待办箱才有设置为已读
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
GetDataModel data = new GetDataModel();
B_OA_SupervisionReminder en = new B_OA_SupervisionReminder();
en.Condition.Add("caseId=" + caseId);
data.reminderBaseInfor = Utility.Database.QueryObject<B_OA_SupervisionReminder>(en);
B_OA_Supervision_Bill supervisionBill = new B_OA_Supervision_Bill();
supervisionBill.Condition.Add("caseid =" + caseId);
data.supervisionBill = Utility.Database.QueryObject<B_OA_Supervision_Bill>(supervisionBill);
if (data.reminderBaseInfor == null)
{
var baseInfo = new B_OA_SupervisionReminder();
baseInfo.createDate = DateTime.Now.ToString();
baseInfo.reminderManId = userid;
baseInfo.reminderManName = ComClass.GetUserInfo(userid).CnName;
data.reminderBaseInfor = baseInfo;
//督办通知单据
B_OA_Supervision_Bill supervisionBill_ad = new B_OA_Supervision_Bill();
supervisionBill_ad.content = GetSupervisionBill();
supervisionBill_ad.year = DateTime.Now.Year.ToString();
supervisionBill_ad.createDate = DateTime.Now.ToString("yyyy年MM月dd日");
data.supervisionBill = supervisionBill_ad;
}
return data;
}
示例13: GetData
public object GetData(string userid, string caseId, string baid, string actid)
{
try
{
if (!String.IsNullOrEmpty(actid))
{
//只有待办箱才有设置为已读
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
}
var data = new GetDataModel();
// 一个会议有多个议程
#region 会议信息
B_OA_ConferenceMain en = new B_OA_ConferenceMain();
en.Condition.Add("workflowcaseid = " + caseId);
data.baseInfo = Utility.Database.QueryObject<B_OA_ConferenceMain>(en);
//新建
if (data.baseInfo == null)
{
var baseInfo = new B_OA_ConferenceMain();
//var userInfo = ComClass.GetUserInfo(userid);
data.baseInfo = baseInfo;
}
#endregion
#region 议程信息列表
if (data.baseInfo != null)
{
B_OA_Conf_Agenda agendaEnt = new B_OA_Conf_Agenda();
agendaEnt.Condition.Add("workflowcaseid=" + data.baseInfo.workflowcaseid);
data.agendaList = Utility.Database.QueryList<B_OA_Conf_Agenda>(agendaEnt);
}
#endregion
#region 编辑行议程信息
if (data.baseInfo != null)
{
data.agendaListDetail = new B_OA_Conf_Agenda();
data.agendaListDetail.workflowcaseid = data.baseInfo.workflowcaseid;
}
#endregion
return data;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例14: GetData
public object GetData(string userid, string caseId, string baid, string actid)
{
try
{
if (!String.IsNullOrEmpty(actid))
{
//只有待办箱才有设置为已读
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
}
var data = new GetDataModel();
IDbTransaction tran = Utility.Database.BeginDbTransaction();
#region 基础信息
B_OA_ReceiveDoc_QuZhan en = new B_OA_ReceiveDoc_QuZhan();
en.Condition.Add("caseID = " + caseId);
data.baseInfo = Utility.Database.QueryObject<B_OA_ReceiveDoc_QuZhan>(en);
//新建
if (data.baseInfo == null)
{
var baseInfo = new B_OA_ReceiveDoc_QuZhan();
StringBuilder strSql = new StringBuilder();
baseInfo.recordManId = userid;
baseInfo.recordManName = ComClass.GetUserInfo(userid).CnName;
//var userInfo = ComClass.GetUserInfo(userid);
data.baseInfo = baseInfo;
//此设置用于绑定来文编号
strSql.Clear();
strSql.AppendFormat(@"select FileTypeId as id ,remark ,FileTypeName as mc from B_OA_FileType
WHERE ParentId =(select FileTypeId from B_OA_FileType WHERE flagType ='2') order by RankID asc;");
data.receiveDic = Utility.Database.ExcuteDataSet(strSql.ToString()).Tables[0];
strSql.Clear();
strSql.AppendFormat(@"select Max(substring(code,9,5)) from B_OA_ReceiveDoc_QuZhan");
DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran);
string code = ds.Tables[0].Rows[0][0].ToString();
data.code = code;
}
#endregion
return data;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}
示例15: GetData
public object GetData(string userid, string caseId, string baid)
{
try
{
//只有待办箱才有设置为已读
if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid);
GetDataModel data = new GetDataModel();
return null;
}
catch (Exception ex)
{
ComBase.Logger(ex);
throw (new Exception("获取数据失败!", ex));
}
}