示例#1
0
        private static string AddMeetingInfo(IEnumerable<XElement> eGFunc)
        {

            try
            {
                string StrReturn = "";
                if (eGFunc.Count() == 0)
                {
                    return StrReturn;
                }

                string strEmployeeID = string.Empty;
                string strOwnerID = string.Empty;
                string strOwnerPostID = string.Empty;
                string strOwnerDepartmentID = string.Empty;
                string strOwnerCompanyID = string.Empty;

                foreach (var q in eGFunc)
                {
                    string strName = q.Attribute("Name").Value;
                    switch (strName)
                    {
                        case "CREATEUSERID":
                            strEmployeeID = q.Attribute("Value").Value;
                            break;
                        case "OWNERID":
                            strOwnerID = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTID":
                            strOwnerPostID = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTID":
                            strOwnerDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYID":
                            strOwnerCompanyID = q.Attribute("Value").Value;
                            break;
                    }
                }

                SmtOACommonOffice RoomApp = new SmtOACommonOffice();

                string employeeid = strEmployeeID.Replace("{", "").Replace("}", "");

                //if (pensionTmp == null)
                //{

                T_OA_MEETINGROOMAPP entity = new T_OA_MEETINGROOMAPP();
                entity.MEETINGROOMAPPID = Guid.NewGuid().ToString();
                T_OA_MEETINGROOM room = new T_OA_MEETINGROOM();
                List<T_OA_MEETINGROOM> listroom = new List<T_OA_MEETINGROOM>();
                listroom = RoomApp.GetMeetingRoomNameInfosToCombox();
                if (listroom.Count() > 0)
                    room = listroom.FirstOrDefault();
                else
                    return StrReturn;

                entity.CREATEDATE = DateTime.Now;
                entity.OWNERID = strOwnerID;
                entity.OWNERPOSTID = strOwnerPostID;
                entity.OWNERDEPARTMENTID = strOwnerDepartmentID;
                entity.OWNERCOMPANYID = strOwnerCompanyID;
                entity.CREATEUSERID = strOwnerID;
                entity.CREATEPOSTID = strOwnerPostID;
                entity.CREATEDEPARTMENTID = strOwnerDepartmentID;
                entity.CREATECOMPANYID = strOwnerCompanyID;
                entity.T_OA_MEETINGROOM = room;
                entity.STARTTIME = DateTime.Now;
                entity.ENDTIME = DateTime.Now.AddDays(2);
                string strMsg = "";
                //doc.SendDocAdd(entity);
                //ser.PensionMasterAdd(entity, ref strMsg);
                strMsg = RoomApp.MeetingRoomAppInfoAdd(entity);
                if (string.IsNullOrEmpty(strMsg))
                {
                    StrReturn = entity.MEETINGROOMAPPID;
                }
                return StrReturn;

            }
            catch (Exception e)
            {
                string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]";
                Tracer.Debug(abc);
                return abc;

            }

        }
示例#2
0
        private static string AddMeetingRoomInfo(IEnumerable<XElement> eGFunc)
        {

            try
            {
                if (eGFunc.Count() == 0)
                {
                    return "";
                }

                string strEmployeeID = string.Empty;
                string strOwnerID = string.Empty;
                string strOwnerPostID = string.Empty;
                string strOwnerDepartmentID = string.Empty;
                string strOwnerCompanyID = string.Empty;

                foreach (var q in eGFunc)
                {
                    string strName = q.Attribute("Name").Value;
                    switch (strName)
                    {
                        case "CREATEUSERID":
                            strEmployeeID = q.Attribute("Value").Value;
                            break;
                        case "OWNERID":
                            strOwnerID = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTID":
                            strOwnerPostID = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTID":
                            strOwnerDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYID":
                            strOwnerCompanyID = q.Attribute("Value").Value;
                            break;
                    }
                }

                SmtOACommonOffice doc = new SmtOACommonOffice();

                string employeeid = strEmployeeID.Replace("{", "").Replace("}", "");

                //if (pensionTmp == null)
                //{

                T_OA_SENDDOC entity = new T_OA_SENDDOC();
                entity.SENDDOCID = Guid.NewGuid().ToString();

                entity.CREATEDATE = DateTime.Now;
                entity.OWNERID = strOwnerID;
                entity.OWNERPOSTID = strOwnerPostID;
                entity.OWNERDEPARTMENTID = strOwnerDepartmentID;
                entity.OWNERCOMPANYID = strOwnerCompanyID;
                entity.CREATEUSERID = strOwnerID;
                entity.CREATEPOSTID = strOwnerPostID;
                entity.CREATEDEPARTMENTID = strOwnerDepartmentID;
                entity.CREATECOMPANYID = strOwnerCompanyID;
                string strMsg = "";
                doc.SendDocAdd(entity);
                //ser.PensionMasterAdd(entity, ref strMsg);
                return entity.SENDDOCID;
                //}
                //else
                //{
                //    return pensionTmp.PENSIONMASTERID;
                //}
            }
            catch (Exception e)
            {
                string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]";
                Tracer.Debug(abc);
                return abc;

            }

        }
示例#3
0
        /// <summary>
        /// 根据传回的XML,添加公文信息
        /// </summary>
        /// <param name="xele"></param>
        private static string AddSenddoc(IEnumerable<XElement> eGFunc)
        {

            try
            {
                string strMsg = "";
                if (eGFunc.Count() == 0)
                {
                    return strMsg;
                }

                string strEmployeeID = string.Empty;
                string strOwnerID = string.Empty;
                string strOwnerPostID = string.Empty;
                string strOwnerDepartmentID = string.Empty;
                string strOwnerCompanyID = string.Empty;
                string strSendDocID = string.Empty;
                foreach (var q in eGFunc)
                {
                    string strName = q.Attribute("Name").Value;
                    switch (strName)
                    {
                        case "SENDDOCID":
                            strSendDocID = q.Attribute("Value").Value;
                            break;
                        case "CREATEUSERID":
                            strEmployeeID = q.Attribute("Value").Value;
                            break;
                        case "OWNERID":
                            strOwnerID = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTID":
                            strOwnerPostID = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTID":
                            strOwnerDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYID":
                            strOwnerCompanyID = q.Attribute("Value").Value;
                            break;
                    }
                }
                //如果有公司发文就直接产生该公文的代办
                if (!string.IsNullOrEmpty(strSendDocID))
                {
                    return strSendDocID;
                }
                SmtOACommonOffice doc = new SmtOACommonOffice();
                //获取默认一个公司发文类型
                T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
                List<T_OA_SENDDOCTYPE> listtype = new List<T_OA_SENDDOCTYPE>();
                listtype = doc.GetDocTypeInfos();
                if (listtype.Count() > 0)
                    doctype = listtype.FirstOrDefault();
                if (doctype == null)
                    return strMsg;
                if (string.IsNullOrEmpty(doctype.SENDDOCTYPE))
                    return strMsg;
                string employeeid = strEmployeeID.Replace("{", "").Replace("}", "");

                //if (pensionTmp == null)
                //{

                T_OA_SENDDOC entity = new T_OA_SENDDOC();
                entity.SENDDOCID = Guid.NewGuid().ToString();
                entity.T_OA_SENDDOCTYPE = doctype;
                entity.GRADED = "普通";
                entity.PRIORITIES = "一般";
                entity.CREATEDATE = DateTime.Now;
                entity.OWNERID = strOwnerID;
                entity.OWNERPOSTID = strOwnerPostID;
                entity.OWNERDEPARTMENTID = strOwnerDepartmentID;
                entity.OWNERCOMPANYID = strOwnerCompanyID;
                entity.CREATEUSERID = strOwnerID;
                entity.CREATEPOSTID = strOwnerPostID;
                entity.CREATEDEPARTMENTID = strOwnerDepartmentID;
                entity.CREATECOMPANYID = strOwnerCompanyID;

                strMsg = doc.SendDocAdd(entity);
                if (string.IsNullOrEmpty(strMsg))
                {
                    strMsg = entity.SENDDOCID;
                }

                return strMsg;

            }
            catch (Exception e)
            {
                string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]";
                Tracer.Debug(abc);
                return abc;

            }

        }