Beispiel #1
0
 public string Send(string BizParams, string userid, string content)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
     try
     {
         SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);
         string caseid = data.baseInfo.caseId;
         if (caseid == null || caseid.Equals(""))
         {
             caseid = developer.Create();//生成一个业务流ID
         }
         if (developer.wfcase.actid == "A001")
         {
             data.baseInfo.createDate = DateTime.Now;
             developer.caseName = ComClass.GetUserInfo(userid).CnName + "-请假申请";
         }
         SaveData(data, tran, caseid);
         developer.Send();
         developer.Commit();
         return Utility.JsonResult(true, "发送成功!");
     }
     catch (Exception ex)
     {
         developer.RollBack();
         ComBase.Logger(ex);
         return Utility.JsonResult(false, "发送失败:" + ex.Message.Replace(":", " "));
     }
 }
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);// new SaveDataModel();

                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.supervisionBaseInfo.title;
                    string titleType = "交办事项督办";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }

                if (developer.wfcase.actid == "A001")
                {
                    data.supervisionBaseInfo.code = CreateSendNo("DB", tran);
                    //当此文未草稿的时候并未生成caseid,而存的是guid,此步骤是将正文路径的caseid字段修改成caseid
                    ChangeGuidToCaseId(developer.wfcase.guid, caseid, tran);

                    //保存督办申请单
                    if (!string.IsNullOrEmpty(data.supervisionBaseInfo.issuerManId))
                    {
                        data.supervisionBill.issuerManId = data.supervisionBaseInfo.issuerManId;
                        data.supervisionBill.issuerManName = data.supervisionBaseInfo.issuerManName.Replace(';', ' ');
                    }

                    SaveSupervisionNoticeBill(data.supervisionBill, caseid, tran);
                }
                SaveData(data, tran, caseid);
                //SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #3
0
 public string Send(string BizParams, string userid, string content)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
     try
     {
         SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);
         string caseid = data.baseInfo.caseId;
         if (caseid == null || caseid.Equals(""))
         {
             caseid = developer.Create();
         }
         if (developer.wfcase.actid == "A001")
         {
             data.baseInfo.traveler = userid;
             data.baseInfo.travelStatus = "1";
             developer.caseName = ComClass.GetUserInfo(userid).CnName + "-出差申请";
         }
         else
         {
             data.baseInfo.travelStatus = "2";
         }
         SaveData(data, tran, caseid);
         developer.Send();
         developer.Commit();
         return Utility.JsonResult(true, "发送成功!");
     }
     catch (Exception ex)
     {
         developer.RollBack();
         ComBase.Logger(ex);
         throw (new Exception("业务发送失败!", ex));
     }
 }
Beispiel #4
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);// new SaveDataModel();

                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.sendDocBaseInfo.wjbt;
                    string titleType = "发文";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }

                if (developer.wfcase.actid == "A001")
                {
                    //当此文未草稿的时候并未生成caseid,而存的是guid,此步骤是将正文路径的caseid字段修改成caseid
                    ChangeGuidToCaseId(developer.wfcase.guid, caseid, tran);
                    //业务关联表
                    if (data.sendRelation != null)
                    {
                        data.sendRelation.caseId = caseid;
                        Utility.Database.Insert(data.sendRelation, tran);
                    }
                }

                ////发文字号的生成
                //if (developer.wfcase.actid == "A007")
                //{
                //    DocNumberRule docNumber = new DocNumberRuleSvc().CreateDocNumber("发文");
                //    data.sendDocBaseInfo.fwzh = string.Format(docNumber.gz, docNumber.nf, docNumber.dqz);
                //}

                //当发文在最后一部时候将相应内容归入文档中心的相应目录
                if (developer.wfcase.actid == "A009")
                {
                    SaveToNotice(tran, caseid, userid);
                }

                SaveData(data, tran, caseid);
                developer.Send();
                developer.Commit();
                return Utility.JsonResult(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #5
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);

                StringBuilder strSql = new StringBuilder();
                strSql.Append(@"SELECT MeetingName,StartTime,EndTime, B.CnName FROM B_OA_Meeting A
            LEFT JOIN FX_UserInfo B ON A.OrganizID = B. UserID
            WHERE MeetingID <> " + data.baseInfo.MeetingID + " AND  MeetingRoomID = " + data.baseInfo.MeetingRoomID + " AND(('" + data.baseInfo.StartTime + "' Between StartTime and EndTime)OR ('" + data.baseInfo.EndTime + "' Between StartTime and EndTime))");
                DataTable table = Utility.Database.ExcuteDataSet(strSql.ToString()).Tables[0];
                if (table.Rows.Count > 0)
                    return Utility.JsonMsg(false, "时间:" + table.Rows[0]["StartTime"].ToString() + " 至 " + table.Rows[0]["EndTime"].ToString() + "\n申请人:" + table.Rows[0]["CnName"].ToString());

                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string titleType = "会议室申请";
                    developer.caseName = data.baseInfo.MeetingName + "-" + titleType;
                    caseid = developer.Create();

                    data.baseInfo.Applicant = userid;
                    data.baseInfo.CreatTime = DateTime.Now.ToString();
                }
                if (developer.wfcase.actid == "A002")
                {
                    data.baseInfo.Approver = userid;
                    data.baseInfo.ApprovalTime = DateTime.Now.ToString();
                    data.baseInfo.Status = 1;

                    DataRowMap rm = new DataRowMap();
                    rm.TableName = "B_OA_WorkFlow_UserId_R";
                    rm.Condition.Add("caseId=" + caseid);
                    Utility.Database.Delete(rm, tran);
                    string[] array = data.baseInfo.ParticipantNameid.Split(';');
                    for (int i = 0; i < array.Length - 1; i++)
                    {
                        DataRowMap add = new DataRowMap();
                        add.TableName = "B_OA_WorkFlow_UserId_R";
                        add.Fields.Add(new FieldInfo("userid", array[i]));
                        add.Fields.Add(new FieldInfo("caseId", caseid));
                        add.Fields.Add(new FieldInfo("datetime", DateTime.Now.ToString()));
                        Utility.Database.Insert(add, tran);
                    }
                }
                SaveData(data, tran, caseid);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                return Utility.JsonMsg(false, "发送失败:" + ex.Message.Replace(":", " "));
            }
        }
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);

                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.baseInfor_Notice.NewsTitle;
                    string titleType = "文档发布";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();

                }

                //string validateInfor = ValiadateInput(data.baseInfor_Notice);

                //if (validateInfor.Length > 0)
                //{
                //    developer.RollBack();
                //    return Utility.JsonResult(false, validateInfor);
                //}

                //保存数据
                if (developer.wfcase.actid == "A002")
                {
                    data.baseInfor_Notice.status = "checkThrough";
                    data.baseInfor_Notice.isSeeInDoor = true;
                    //邮件送达
                    if (data.baseInfor_Notice.isSendEmail == true)
                    {
                        SendEmail(data.baseInfor_Notice, tran,userid);
                    }
                }

                SaveData(data, tran, caseid, userid);
                //SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonResult(true, "发送成功!");

            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #7
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);// new SaveDataModel();

                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.sendDocBaseInfo.title;
                    string titleType = "发文";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }

                if (developer.wfcase.actid == "A001")
                {
                    //当此文未草稿的时候并未生成caseid,而存的是guid,此步骤是将正文路径的caseid字段修改成caseid
                    CommonFunctional.ChangeGuidToCaseId(developer.wfcase.guid, caseid, tran);
                }
                SaveData(data, tran, caseid);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                Utility.Database.Rollback(tran);
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #8
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);
                //                StringBuilder strSql = new StringBuilder();
                //                strSql.Append(@"SELECT
                //	workflowcaseid, sqr, sqrid, sqsj, ycks, ycksid, rs, ycsj, sycl, ccdd, ycsy, B.CnName AS pcr, (CASE pcsj WHEN '1900-1-1 00:00:00' THEN '' ELSE pcsj END) AS pcsj , fhsj, ccr, Stroke, Distance, Status, CONVERT(VARCHAR(16),CreatTime,120) AS CreatTime,
                //	(CASE Status WHEN 0 THEN '待派车' ELSE '已派车' END) AS StatusText,(CONVERT(VARCHAR(16),ycsj,120) +'---' +CONVERT(VARCHAR(16),fhsj,120)) AS useTime, sycl as cph,C.CnName AS driverName
                //FROM B_OA_Car A
                //    LEFT JOIN FX_UserInfo B ON A.pcr = B.UserID
                //    LEFT JOIN FX_UserInfo C ON A.ccr = C.UserID WHERE workflowcaseid <> '" + data.baseInfo.workflowcaseid + "' AND  sycl = '" + data.baseInfo.cph + "' AND(('" + data.baseInfo.ycsj + "' Between ycsj and fhsj)OR ('" + data.baseInfo.fhsj + "' Between ycsj and fhsj))");
                //                DataTable table = Utility.Database.ExcuteDataSet(strSql.ToString()).Tables[0];
                //                if (table.Rows.Count > 0)
                //                    return Utility.JsonMsg(false, "车牌号:" + table.Rows[0]["cph"].ToString() + "\n时间:" + table.Rows[0]["ycsj"].ToString() + " 至 " + table.Rows[0]["fhsj"].ToString() + "\n申请人:" + table.Rows[0]["sqr"].ToString());

                //                strSql = new StringBuilder();
                //                strSql.Append(@"SELECT
                //	workflowcaseid, sqr, sqrid, sqsj, ycks, ycksid, rs, ycsj, sycl, ccdd, ycsy, B.CnName AS pcr, (CASE pcsj WHEN '1900-1-1 00:00:00' THEN '' ELSE pcsj END) AS pcsj , fhsj, ccr, Stroke, Distance, Status, CONVERT(VARCHAR(16),CreatTime,120) AS CreatTime,
                //	(CASE Status WHEN 0 THEN '待派车' ELSE '已派车' END) AS StatusText,(CONVERT(VARCHAR(16),ycsj,120) +'---' +CONVERT(VARCHAR(16),fhsj,120)) AS useTime, sycl as cph,C.CnName AS driverName
                //FROM B_OA_Car A
                //    LEFT JOIN FX_UserInfo B ON A.pcr = B.UserID
                //    LEFT JOIN FX_UserInfo C ON A.ccr = C.UserID WHERE workflowcaseid <> '" + data.baseInfo.workflowcaseid + "' AND  ccr = '" + data.baseInfo.cph + "' AND(('" + data.baseInfo.ycsj + "' Between ycsj and fhsj)OR ('" + data.baseInfo.fhsj + "' Between ycsj and fhsj))");
                //                table = Utility.Database.ExcuteDataSet(strSql.ToString()).Tables[0];
                //                if (table.Rows.Count > 0)
                //                    return Utility.JsonMsg(false, "司机:" + table.Rows[0]["driverName"].ToString() + "\n时间:" + table.Rows[0]["ycsj"].ToString() + " 至 " + table.Rows[0]["fhsj"].ToString() + "\n申请人:" + table.Rows[0]["sqr"].ToString());

                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.baseInfo.useMan;
                    string titleType = "用车申请";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }
                SaveData(data, tran, caseid);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #9
0
 public string Send(string BizParams, string userid, string content)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
     try
     {
         SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);
         string caseid = developer.caseid;
         if (String.IsNullOrEmpty(caseid))
         {
             string unitName = ComClass.GetUserInfo(data.fixedAssets.applyManId).CnName;
             string titleType = "采购申请";
             developer.caseName = unitName + "-" + titleType;
             caseid = developer.Create();
         }
         SaveData(data, tran, caseid, developer.wfcase.actid);
         developer.Send();
         developer.Commit();
         return Utility.JsonMsg(true, "发送成功!");
     }
     catch (Exception ex)
     {
         Utility.Database.Rollback(tran);
         ComBase.Logger(ex);
         return Utility.JsonMsg(false, "发送失败:" + ex.Message.Replace(":", " "));
     }
 }
Beispiel #10
0
        /// <summary>
        /// 封装的发送,通过委托保存数据
        /// </summary>
        /// <param name="BizParams"></param>
        /// <param name="userid"></param>
        /// <param name="saveData"></param>
        /// <param name="CaseName"></param>
        public static void send(string BizParams, string userid, Action<IDbTransaction, string> saveData, string CaseName)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                //SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);
                string caseid = developer.caseid;

                if (String.IsNullOrEmpty(caseid))
                {
                    //developer.caseName = data.baseInfo.traveler + "-出差申请";// 设置流程实例标题
                    //developer.wfcase.caseName= data.baseInfo.traveler + "-出差申请"; //这种写法也可以
                    developer.wfcase.caseName = CaseName;
                    caseid = developer.Create();//生成一个业务流ID
                }

                saveData(tran, caseid);
                developer.Send();
                developer.Commit();
                //return Utility.JsonResult(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);
                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.baseInfo.wjmc;
                    string titleType = "来文";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }
                if (developer.wfcase.actid == "A001")
                {
                    //来文编号
                    B_OA_FileType fileType = new B_OA_FileType();
                    fileType.Condition.Add("FileTypeId =" + data.baseInfo.lwdwTypeId);
                    fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran);
                    int code = int.Parse(fileType.remark) + 1;
                    fileType.remark = code.ToString();
                    fileType.Condition.Add("FileTypeId =" + data.baseInfo.lwdwTypeId);
                    Utility.Database.Update(fileType, tran);

                    data.baseInfo.code = data.baseInfo.code + "-" + code;

                }
                SaveData(data, tran, caseid);
                //SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);
                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.baseInfor_Notice.NewsTitle;
                    string titleType = "通知公告";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }

                //保存数据
                if (developer.wfcase.actid == "A003")
                {
                    data.baseInfor_Notice.status = "1";
                    data.baseInfor_Notice.Chk = "1";
                    data.baseInfor_Notice.isSeeInDoor = true;
                }
                SaveData(data, tran, caseid, userid);
                SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");

            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #13
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                SaveShouWenDataModel data = JsonConvert.DeserializeObject<SaveShouWenDataModel>(content);
                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.baseInfo.wjbt;
                    string titleType = "收文";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();

                    data.baseInfo.jbgs = ComClass.GetUserInfo(userid).CnName;
                }

                if (developer.wfcase.flowid == "w000066")
                {
                    if (developer.wfcase.actid == "A003")
                    {
                        SaveToNotice(tran, caseid, userid);
                    }
                }
                else if (developer.wfcase.flowid == "w000067")
                {
                    if (developer.wfcase.actid == "A009")
                    {
                        SaveToNotice(tran, caseid, userid);
                    }
                }
                SaveData(data, tran, caseid);
                //SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonResult(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
 public string Send(string BizParams, string userid, string content)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
     try
     {
         GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);// new SaveDataModel();
         string caseid = developer.caseid;
         if (String.IsNullOrEmpty(caseid))
         {
             string unitName = data.delayApplyBaseInfor.title;
             string titleType = "督办延期申请";
             developer.caseName = unitName + "-" + titleType;
             caseid = developer.Create();
         }
         StringBuilder strSql = new StringBuilder();
         SaveData(data, tran, caseid);
         //SetCaseName(data, developer);
         developer.Send();
         //修改延期时间
         if (developer.wfcase.actid == "A003")
         {
             SetLimiteData(caseid, tran);
         }
         developer.Commit();
         return Utility.JsonMsg(true, "发送成功!");
     }
     catch (Exception ex)
     {
         developer.RollBack();
         ComBase.Logger(ex);
         throw (new Exception("业务发送失败!", ex));
     }
 }
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);
                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.baseInfo.wjmc;
                    string titleType = "来文";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }

                SaveData(data, tran, caseid);
                //SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonResult(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #16
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);
                string caseid = developer.caseid;

                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.sendDocBaseInfo.title;
                    string titleType = "环科所发文";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();

                    //作者名字
                    data.sendDocBaseInfo.createManName = ComClass.GetUserInfo(userid).CnName;
                }

                if (developer.wfcase.actid == "A001")
                {

                    //业务关联表
                    if (data.sendRelation.relationCaseId != "")
                    {
                        B_OA_SendDoc_R sendR = new B_OA_SendDoc_R();
                        sendR.actId = data.sendRelation.actId;
                        sendR.caseId = caseid;
                        sendR.wId = data.sendRelation.wId;
                        sendR.filePath = data.sendRelation.filePath;
                        sendR.triggerActId = data.sendRelation.triggerActId;
                        sendR.relationCaseId = data.sendRelation.relationCaseId;
                        Utility.Database.Insert<B_OA_SendDoc_R>(sendR, tran);
                    }
                }

                SaveData(data, tran, caseid);
                SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #17
0
 public string Send(string BizParams, string userid, string content)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
     try
     {
         SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);
         string caseid = developer.Create();
         SaveData(data, tran, caseid);
         SetCaseName(data, developer);
         developer.Send();
         developer.Commit();
         return Utility.JsonMsg(true, "发送成功!");
     }
     catch (Exception ex)
     {
         developer.RollBack();
         ComBase.Logger(ex);
         return Utility.JsonMsg(false, "发送失败:" + ex.Message.Replace(":", " "));
     }
 }
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content);
                string caseid = developer.caseid;
                if (String.IsNullOrEmpty(caseid))
                {
                    string unitName = data.sendDocBaseInfo.title;
                    string titleType = "内部事项";
                    developer.caseName = unitName + "-" + titleType;
                    caseid = developer.Create();
                }
                if (developer.wfcase.actid == "A001")
                {
                    string strSql = "select Max(substring(code,9,5)) from B_OA_SendDoc_Inner_QuZhan";
                    DataSet ds = Utility.Database.ExcuteDataSet(strSql, tran);
                    string code = ds.Tables[0].Rows[0][0].ToString();
                    if (code == "")
                    {
                        data.sendDocBaseInfo.code = "NB[" + DateTime.Now.Year.ToString() + "]00001";
                    }
                    else
                    {
                        data.sendDocBaseInfo.code = "NB[" + DateTime.Now.Year + "]" + (int.Parse(code) + 1).ToString();
                    }

                }
                SaveData(data, tran, caseid);
                //SetCaseName(data, developer);
                developer.Send();
                developer.Commit();
                return Utility.JsonResult(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                throw (new Exception("业务发送失败!", ex));
            }
        }
Beispiel #19
0
        public string Send(string BizParams, string userid, string content)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran);
            try
            {
                SaveDataModel data = JsonConvert.DeserializeObject<SaveDataModel>(content);

                StringBuilder strSql = new StringBuilder();
                strSql.Append(@"SELECT MeetingName,StartTime,EndTime, B.CnName FROM B_OA_Meeting A
            LEFT JOIN FX_UserInfo B ON A.OrganizID = B. UserID
            WHERE MeetingID <> " + data.baseInfo.MeetingID + " AND  MeetingRoomID = " + data.baseInfo.MeetingRoomID + " AND(('" + data.baseInfo.StartTime + "' Between StartTime and EndTime)OR ('" + data.baseInfo.EndTime + "' Between StartTime and EndTime))");
                DataTable table = Utility.Database.ExcuteDataSet(strSql.ToString()).Tables[0];
                if (table.Rows.Count > 0)
                    return Utility.JsonMsg(false, "时间:" + table.Rows[0]["StartTime"].ToString() + " 至 " + table.Rows[0]["EndTime"].ToString() + "\n申请人:" + table.Rows[0]["CnName"].ToString());

                string caseid = data.baseInfo.CaseID;
                if (caseid == null || caseid.Equals(""))
                {
                    caseid = developer.Create();//生成一个业务流ID
                }

                if (developer.wfcase.actid == "A001")
                {
                    data.baseInfo.Applicant = userid;
                    data.baseInfo.CreatTime = DateTime.Now.ToString();
                }
                else if (developer.wfcase.actid == "A002")
                {
                    data.baseInfo.Approver = userid;
                    data.baseInfo.ApprovalTime = DateTime.Now.ToString();
                    data.baseInfo.Status = 1;
                }
                SaveData(data, tran, caseid);
                developer.caseName = data.baseInfo.MeetingName + "-会议申请";// 设置流程实例标题
                developer.Send();
                developer.Commit();
                return Utility.JsonMsg(true, "发送成功!");
            }
            catch (Exception ex)
            {
                developer.RollBack();
                ComBase.Logger(ex);
                return Utility.JsonMsg(false, "发送失败:" + ex.Message.Replace(":", " "));
            }
        }