Ejemplo n.º 1
0
 public object DeleteData(string caseId,string userid)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     try
     { //审核记录表
         if (!string.IsNullOrEmpty(caseId))
         {
             B_OA_Car car = new B_OA_Car();
             car.Condition.Add("workflowcaseid=" + caseId);
             Utility.Database.Delete(car, tran);
             //删除相关业务,业务办结不可删除
             CommonFunctional.DeleteWorkFlowCase(caseId, userid, tran);
             Utility.Database.Commit(tran);
         }
         else
         {
             throw (new Exception("删除数据失败"));
         }
         bool b = true;
         return new
         {
             b = b
         };
     }
     catch (Exception ex)
     {
         ComBase.Logger(ex);
         throw (new Exception("删除失败!", ex));
     }
 }
Ejemplo n.º 2
0
 public object GetCarByCaseId(string caseid)
 {
     var tran = Utility.Database.BeginDbTransaction();
     try
     {
         B_OA_Car baseInfor = new B_OA_Car();
         baseInfor.Condition.Add("workflowcaseid = " + caseid);
         baseInfor = Utility.Database.QueryObject<B_OA_Car>(baseInfor);
         Utility.Database.Commit(tran);
         return new
         {
             baseInfor = baseInfor
         };
     }
     catch (Exception ex)
     {
         Utility.Database.Rollback(tran);
         ComBase.Logger(ex);
         throw (new Exception("打印失败!", ex));
     }
 }
Ejemplo n.º 3
0
        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();
                //                StringBuilder strSql = new StringBuilder();
                //                strSql.Append(String.Format(@"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.UserIDWW
                //    LEFT JOIN FX_UserInfo C ON A.ccr = C.UserID
                //WHERE
                //	workflowcaseid = '{0}'
                //", caseId));
                //DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString());
                //data.dataList = (List<B_OA_Car>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_Car>));
                //新建
                if (caseId == "")
                {
                    DeptInfoAndUserInfo userData = ComClass.GetDeptAndUserByUserId(userid);
                    data.baseInfo = new B_OA_Car();
                    data.baseInfo.CreatTime = DateTime.Now;
                    data.baseInfo.useManId = userData.userinfo.UserID;
                    data.baseInfo.useMan = userData.userinfo.CnName;
                    data.baseInfo.applyDepartment = userData.deptinfo.DPName;
                    data.baseInfo.useManPhone = userData.userinfo.Phone;
                }

                else
                {
                    B_OA_Car car = new B_OA_Car();
                    car.Condition.Add("workflowcaseid=" + caseId);
                    car = Utility.Database.QueryObject<B_OA_Car>(car);
                    data.baseInfo = car;
                }

                return data;
            }
            catch (Exception ex)
            {
                ComBase.Logger(ex);
                throw (new Exception("获取数据失败!", ex));
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 创建一个Word数据
        /// </summary>
        /// <param name="caseid"></param>
        /// <returns></returns>
        private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran)
        {
            B_OA_Car car = new B_OA_Car();
            car.Condition.Add("workflowcaseid=" + caseid);
            car = Utility.Database.QueryObject<B_OA_Car>(car, tran);
            Dictionary<string, Object> dict = new Dictionary<string, Object>();
            //申请部门
            dict.Add("applyDepartment", car.applyDepartment == null ? "" : car.applyDepartment);
            //出车时间
            if (!string.IsNullOrEmpty(car.strartTime.ToString()))
            {
                string createDate = (DateTime.Parse(car.strartTime.ToString())).ToString("yyyy年MM月dd日 hh时");
                dict.Add("strartTime", createDate);//主送
            }
            if (!string.IsNullOrEmpty(car.endTime.ToString()))
            {
                string createDate = (DateTime.Parse(car.endTime.ToString())).ToString("yyyy年MM月dd日 hh时");
                dict.Add("endTime", createDate);//主送
            }
            //出差地点
            dict.Add("strarDestination", car.strarDestination == null ? "" : car.strarDestination);
            dict.Add("endDestination", car.endDestination == null ? "" : car.endDestination);
            //出差事由
            dict.Add("travelReson", car.travelReson == null ? "" : car.travelReson);
            //用车人名单
            dict.Add("personList", car.personList == null ? "" : car.personList);
            //用车联系人
            dict.Add("useMan", car.useMan == null ? "" : car.useMan);
            //用车联系人电话
            dict.Add("useManPhone", car.useManPhone == null ? "" : car.useManPhone);
            //驾驶员名字
            dict.Add("diverMan", car.diverMan == null ? "" : car.diverMan);
            //派出车辆
            dict.Add("carName", car.carName == null ? "" : car.carName);
            //备注
            dict.Add("remark", car.remark == null ? "" : car.remark);

            //获取所有评阅意见
            FX_WorkFlowBusAct work = new FX_WorkFlowBusAct();
            work.Condition.Add("CaseID = " + caseid);
            work.OrderInfo = "ReceDate asc";
            List<FX_WorkFlowBusAct> listWork = Utility.Database.QueryList<FX_WorkFlowBusAct>(work, tran);
            //将所有工作流信息格式化
            List<B_OA_PrintParagragh> listPara = CommonFunctional.ChangeListToMatch(listWork);
            //办公室核稿意见
            List<B_OA_PrintParagragh> officeSugList = new List<B_OA_PrintParagragh>();
            int k = 0;
            //办公室核稿意见
            for (k = 0; k < listPara.Count; k++)
            {
                if (listPara[k].ActID == "A002")
                {
                    officeSugList.Add(listPara[k]);
                }
            }
            //办公室核稿意见
            var imgOfficeSugListList = new OpenXmlHelper.ImageTextArray[officeSugList.Count];
            for (k = 0; k < officeSugList.Count; k++)
            {
                imgOfficeSugListList[k] = new OpenXmlHelper.ImageTextArray();
                imgOfficeSugListList[k].Images = officeSugList[k].Image;
                imgOfficeSugListList[k].Text = officeSugList[k].Text;
                imgOfficeSugListList[k].Foots = officeSugList[k].Foots;
                imgOfficeSugListList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right;
            }
            dict.Add("officeSug", imgOfficeSugListList);
            return dict;
        }
Ejemplo n.º 5
0
        public bool DeleteCase(string caseid, string userid, Object obj)
        {
            IDbTransaction tran = (IDbTransaction)obj;
            //加入针对不同的业务的删除前处理
            FX_WorkFlowCase workFlow = new FX_WorkFlowCase();
            workFlow.Condition.Add("ID =" + caseid);
            workFlow = Utility.Database.QueryObject<FX_WorkFlowCase>(workFlow, tran);
            if (workFlow != null)
            {
                string flowId = workFlow.FlowID;
                switch (flowId)
                {
                    case "W000098": //发文
                        B_OA_SendDoc_QuZhan sendDoc = new B_OA_SendDoc_QuZhan();
                        sendDoc.Condition.Add("caseid=" + caseid);
                        Utility.Database.Delete(sendDoc, tran);
                        break;
                    case "W000099": //收文
                        B_OA_ReceiveDoc_QuZhan receiveDoc = new B_OA_ReceiveDoc_QuZhan();
                        receiveDoc.Condition.Add("caseid=" + caseid);
                        Utility.Database.Delete(receiveDoc, tran);
                        break;
                    case "W000100": //内部事项
                        B_OA_SendDoc_Inner_QuZhan innderDoc = new B_OA_SendDoc_Inner_QuZhan();
                        innderDoc.Condition.Add("caseId=" + caseid);
                        Utility.Database.Delete(innderDoc, tran);
                        break;
                    case "W000070": //车辆申请
                        B_OA_Car car = new B_OA_Car();
                        car.Condition.Add("workflowcaseid=" + caseid);
                        Utility.Database.Delete(car, tran);
                        break;
                    case "W000071": //会议申请
                        B_OA_Meeting data = new B_OA_Meeting();
                        data.Condition.Add("CaseID=" + caseid);
                        Utility.Database.Delete(data, tran);
                        break;
                    case "W000079": //请假申请
                        B_OA_LeaveList leave = new B_OA_LeaveList();
                        leave.Condition.Add("caseId=" + caseid);
                        Utility.Database.Delete(leave, tran);
                        break;
                    case "W000080": //出差申请
                        B_OA_TravelList travel = new B_OA_TravelList();
                        travel.Condition.Add("caseId=" + caseid);
                        Utility.Database.Delete(travel, tran);
                        break;
                    case "W000089": //通知公告
                        B_OA_Notice notice = new B_OA_Notice();
                        notice.Condition.Add("caseid=" + caseid);
                        Utility.Database.Delete(notice, tran);
                        break;
                }
                if (!string.IsNullOrEmpty(caseid))
                {
                    //删除正文路径
                    B_Common_CreateDoc createDoc = new B_Common_CreateDoc();
                    createDoc.Condition.Add("caseid=" + caseid);
                    Utility.Database.Delete(createDoc, tran);
                    //删除附件
                    FX_AttachMent attach  = new FX_AttachMent();
                    attach.Condition.Add("CaseID="+caseid);
                    Utility.Database.Delete(attach, tran);

                }
            }
            return true;
        }