Exemple #1
0
        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_TravelList en = new B_OA_TravelList();
                en.Condition.Add("caseId=" + caseId);
                data.baseInfo = Utility.Database.QueryObject<B_OA_TravelList>(en);
                if (data.baseInfo == null)
                {
                    DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(userid);
                    var baseInfo = new B_OA_TravelList();
                    baseInfo.travelerName = d_u_Infor.userinfo.CnName;
                    baseInfo.dpname = d_u_Infor.deptinfo.DPName;
                    data.baseInfo = baseInfo;
                }
                else
                {
                    DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(data.baseInfo.traveler);
                    data.baseInfo.travelerName = d_u_Infor.userinfo.CnName;
                    data.baseInfo.dpname = d_u_Infor.deptinfo.DPName;
                }
                return data;
            }
            catch (Exception ex)
            {
                ComBase.Logger(ex);
                throw (new Exception("获取数据失败!", ex));
            }
        }
Exemple #2
0
 public object DeleteData(string caseId, string userid)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     try
     { //审核记录表
         if (!string.IsNullOrEmpty(caseId))
         {
             B_OA_TravelList data = new B_OA_TravelList();
             data.Condition.Add("caseId=" + caseId);
             Utility.Database.Delete(data, tran);
             engineAPI.Delete(caseId, userid, tran);
             Utility.Database.Commit(tran);
         }
         else
         {
             throw (new Exception("删除数据失败"));
         }
         bool b = true;
         return new
         {
         };
     }
     catch (Exception ex)
     {
         ComBase.Logger(ex);
         throw (new Exception("删除失败!", ex));
     }
 }
Exemple #3
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;
        }
Exemple #4
0
 public object GetTravelByCaseId(string caseid)
 {
     var tran = Utility.Database.BeginDbTransaction();
     try
     {
         B_OA_TravelList baseInfor = new B_OA_TravelList();
         baseInfor.Condition.Add("caseId = " + caseid);
         baseInfor = Utility.Database.QueryObject<B_OA_TravelList>(baseInfor, tran);
         DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(baseInfor.traveler);
         baseInfor.travelerName = d_u_Infor.userinfo.CnName;
         baseInfor.dpname = d_u_Infor.deptinfo.DPName;
         Utility.Database.Commit(tran);
         return new
         {
             baseInfor = baseInfor
         };
     }
     catch (Exception ex)
     {
         Utility.Database.Rollback(tran);
         ComBase.Logger(ex);
         throw (new Exception("获取数据失败!", ex));
     }
 }
Exemple #5
0
        /// <summary>
        /// 创建一个Word数据
        /// </summary>
        /// <param name="caseid"></param>
        /// <returns></returns>
        private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran)
        {
            //创建内容
            Dictionary<string, Object> dict = new Dictionary<string, Object>();
            B_OA_TravelList en = new B_OA_TravelList();
            en.Condition.Add("caseId=" + caseid);
            en = Utility.Database.QueryObject<B_OA_TravelList>(en);
            DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(en.traveler);
            en.travelerName = d_u_Infor.userinfo.CnName;
            en.dpname = d_u_Infor.deptinfo.DPName;

            dict.Add("travelDps", en.travelDps == null ? "" : en.travelDps);
            dict.Add("travelAddress", en.travelAddress == null ? "" : en.travelAddress);
            dict.Add("travelReason", en.travelReason == null ? "" : en.travelReason);
            dict.Add("carStatus", en.carStatus == null ? "" : en.carStatus);
            dict.Add("remark", en.remark == null ? "" : en.remark);
            if (!string.IsNullOrEmpty(en.ortherMan))
            {
                en.travelNames = en.travelNames  + en.ortherMan;
            }
            dict.Add("travelNames", en.travelNames == null ? "" : en.travelNames);
            string startTime = "";
            if (!string.IsNullOrEmpty(en.travelStartTime.ToString()))
            {
                startTime = (DateTime.Parse(en.travelStartTime.ToString())).ToString("yyyy年MM月dd日 hh:mm");
            }
            string endTime = "";
            if (!string.IsNullOrEmpty(en.travelEndTime.ToString()))
            {
                endTime = (DateTime.Parse(en.travelEndTime.ToString())).ToString("yyyy年MM月dd日 hh:mm");
            }
            dict.Add("travelStartTime", startTime);
            dict.Add("travelEndTime", endTime);

            //获取所有评阅意见
            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> szrSugList = new List<B_OA_PrintParagragh>();
            //站领导意见
            List<B_OA_PrintParagragh> zldSugList = new List<B_OA_PrintParagragh>();
            int k = 0;
            //室主任意见
            for (k = 0; k < listPara.Count; k++)
            {
                if (listPara[k].ActID == "A002")
                {
                    szrSugList.Add(listPara[k]);
                }
                else if (listPara[k].ActID == "A003")
                {
                    zldSugList.Add(listPara[k]);
                }
            }
            //室主任意见
            var imgSzrSugList = new OpenXmlHelper.ImageTextArray[szrSugList.Count];
            for (k = 0; k < szrSugList.Count; k++)
            {
                imgSzrSugList[k] = new OpenXmlHelper.ImageTextArray();
                imgSzrSugList[k].Images = szrSugList[k].Image;
                imgSzrSugList[k].Text = szrSugList[k].Text;
                imgSzrSugList[k].Foots = szrSugList[k].Foots;
                imgSzrSugList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right;
            }
            dict.Add("szrSug", imgSzrSugList);

            //站领导意见
            var imgZldSugList = new OpenXmlHelper.ImageTextArray[zldSugList.Count];
            for (k = 0; k < zldSugList.Count; k++)
            {
                imgZldSugList[k] = new OpenXmlHelper.ImageTextArray();
                imgZldSugList[k].Images = zldSugList[k].Image;
                imgZldSugList[k].Text = zldSugList[k].Text;
                imgZldSugList[k].Foots = zldSugList[k].Foots;
                imgZldSugList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right;
            }
            dict.Add("zldSug", imgZldSugList);
            return dict;
        }