コード例 #1
0
ファイル: OAReceiveDocSearchSvc.cs プロジェクト: hehaiquan/OA
 public object DeleteDoc(string caseId, string userid)
 {
     IDbTransaction tran = Utility.Database.BeginDbTransaction();
     try
     { //审核记录表
         if (!string.IsNullOrEmpty(caseId))
         {
             B_OA_ReceiveDoc_QuZhan receiveDoc = new B_OA_ReceiveDoc_QuZhan();
             receiveDoc.Condition.Add("caseid="+caseId);
             Utility.Database.Delete(receiveDoc, tran);
             engineAPI.Delete(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));
     }
 }
コード例 #2
0
        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));
            }
        }
コード例 #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();
                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();
                    string strSql = "select Max(substring(code,9,5)) from B_OA_ReceiveDoc_QuZhan";
                    DataSet ds = Utility.Database.ExcuteDataSet(strSql, tran);
                    string code = ds.Tables[0].Rows[0][0].ToString();
                    if (code == "")
                    {
                        baseInfo.code = "LW[" + DateTime.Now.Year.ToString() + "]00001";
                    }
                    else
                    {
                        baseInfo.code = "LW[" + DateTime.Now.Year + "]" + (int.Parse(code) + 1).ToString();
                    }
                    baseInfo.recordManId = userid;
                    baseInfo.recordManName = ComClass.GetUserInfo(userid).CnName;
                    //var userInfo = ComClass.GetUserInfo(userid);
                    data.baseInfo = baseInfo;
                }
                #endregion

                return data;
            }
            catch (Exception ex)
            {
                ComBase.Logger(ex);
                throw (new Exception("获取数据失败!", ex));
            }
        }
コード例 #4
0
        private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran)
        {
            B_OA_ReceiveDoc_QuZhan receiveDoc = new B_OA_ReceiveDoc_QuZhan();
            receiveDoc.Condition.Add("caseid=" + caseid);
            receiveDoc = Utility.Database.QueryObject<B_OA_ReceiveDoc_QuZhan>(receiveDoc, tran);

            Dictionary<string, Object> dict = new Dictionary<string, Object>();
            dict.Add("code", receiveDoc.code == null ? "" : receiveDoc.code);//编号
            dict.Add("lwdw", receiveDoc.lwdw == null ? "" : receiveDoc.lwdw);//来文单位
            dict.Add("wjmc", receiveDoc.wjmc == null ? "" : receiveDoc.wjmc);//文件名称
            dict.Add("bgsnbyj", receiveDoc.toDoSug == null ? "" : receiveDoc.toDoSug);//文件名称
            dict.Add("remark", receiveDoc.remark == null ? "" : receiveDoc.remark);//备注

            if (!string.IsNullOrEmpty(receiveDoc.lwrq.ToString()))
            {
                string createDate = (DateTime.Parse(receiveDoc.lwrq.ToString())).ToString("yyyy年MM月dd日");
                dict.Add("createDate", createDate);//主送
            }

            if (!string.IsNullOrEmpty(receiveDoc.zbsj.ToString()))
            {
                string zbsj = (DateTime.Parse(receiveDoc.zbsj.ToString())).ToString("yyyy年MM月dd日");
                dict.Add("zbsj", zbsj);//主送
            }
            //获取所有评阅意见
            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> ldpsList = new List<B_OA_PrintParagragh>();
            int k = 0;
            //领导批示
            for (k = 0; k < listPara.Count; k++)
            {
                if (listPara[k].ActID == "A005")
                {
                    ldpsList.Add(listPara[k]);
                }
            }
            //承办科室负责人
            var imgLdpsList = new OpenXmlHelper.ImageTextArray[ldpsList.Count];
            for (k = 0; k < ldpsList.Count; k++)
            {
                imgLdpsList[k] = new OpenXmlHelper.ImageTextArray();
                imgLdpsList[k].Images = ldpsList[k].Image;
                imgLdpsList[k].Text = ldpsList[k].Text;
                imgLdpsList[k].Foots = ldpsList[k].Foots;
                imgLdpsList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right;
            }
            dict.Add("ldps", imgLdpsList);
            return dict;
        }
コード例 #5
0
ファイル: SkyLandBizFrame.cs プロジェクト: leo481/OA
        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;
        }