コード例 #1
0
 //增
 public string DocTypeAdd(T_OA_SENDDOCTYPE obj)
 {
     using (BumfDocTypeManagementBll TypeBll = new BumfDocTypeManagementBll())
     {
         return(TypeBll.AddDocTypeInfo(obj));
     }
 }
コード例 #2
0
ファイル: DocTypeForm.xaml.cs プロジェクト: JuRogn/OA
        private void InitDocType(Action actionenum, T_OA_SENDDOCTYPE TypeObj)
        {
            //loadbar.Start();
            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (actionenum == Action.Add)
            {

                RefreshUI(RefreshedTypes.HideProgressBar);
                //loadbar.Stop();
            }
            if (actionenum == Action.Edit)
            {

                this.txtDocType.IsEnabled = false;
                GetDocTypeDetailInfo(TypeObj);
            }
            if (actionenum == Action.Read)
            {

                this.txtDocType.IsEnabled = false;
                this.txtDemo.IsEnabled = false;
                this.RbtNo.IsEnabled = false;
                this.rbtYes.IsEnabled = false;
                GetDocTypeDetailInfo(TypeObj);
            }
        }
コード例 #3
0
 //改
 public void DocTypeInfoUpdate(T_OA_SENDDOCTYPE obj)
 {
     using (BumfDocTypeManagementBll TypeBll = new BumfDocTypeManagementBll())
     {
         TypeBll.UpdateDocTypeInfo(obj);
     }
 }
コード例 #4
0
ファイル: PriviewSendDoc.xaml.cs プロジェクト: jjg0519/OA
        private string tmpStrcbxProritity      = ""; //缓急
        //private SmtOACommonOfficeClient SendDocClient = new SmtOACommonOfficeClient();

        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        //T_OA_SENDDOC senddoc = new T_OA_SENDDOC();
                        senddoc = e.Result;

                        this.tbltitle.Text            = senddoc.SENDDOCTITLE;
                        this.tblsend.Text             = senddoc.SEND;
                        this.tblcopy.Text             = senddoc.CC;
                        tblcontent.RichTextBoxContext = senddoc.CONTENT;
                        this.tbldepartment.Text       = senddoc.DEPARTID;
                        SelectDocType             = senddoc.T_OA_SENDDOCTYPE;
                        this.tbldoctype.Text      = SelectDocType.SENDDOCTYPE;
                        this.tblprioritity.Text   = senddoc.PRIORITIES;
                        this.tblgrade.Text        = senddoc.GRADED;
                        this.tblnum.Text          = DocNum;//获取新的公文编号senddoc.NUM;
                        this.tblcontenttitle.Text = senddoc.SENDDOCTITLE;
                        GetCompanyName(senddoc.OWNERCOMPANYID);
                        GetDepartmentName(senddoc.OWNERDEPARTMENTID);
                        string StrState = "";
                        string StrSave  = "";
                        tmpStrcbxGrade     = senddoc.GRADED;
                        tmpStrcbxProritity = senddoc.PRIORITIES;
                        string StrPublish = "";
                        if (!string.IsNullOrEmpty(senddoc.PUBLISHDATE.ToString()))
                        {
                            StrPublish = System.Convert.ToDateTime(senddoc.PUBLISHDATE.ToString()).ToShortDateString() + "印发";
                        }
                        if (!string.IsNullOrEmpty(senddoc.CREATEDATE.ToString()))
                        {
                            this.tbladddate.Text = System.Convert.ToDateTime(senddoc.CREATEDATE.ToString()).ToShortDateString().Replace("/", "-");
                        }
                        //if (!ctrFile._files.HasAccessory)
                        //{
                        //    SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(GridInfo,16);
                        //}
                        this.tblKeyWord.Text = senddoc.KEYWORDS;
                        this.tblStatus.Text  = "待发布";
                        tblPublishDate.Text  = DocPublishDate;
                        //if (!string.IsNullOrEmpty(StrPublish))
                        //{
                        //    this.tblPublishDate.Text = DocPublishDate.Substring(0, 4) + "年" + DocPublishDate.Substring(5, 2) + "月" + DocPublishDate.Substring(8, 2) + "日印发";
                        //}


                        //ctrFile.IsEnabled = false;
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), e.Error.ToString());
                    return;
                }
            }
        }
コード例 #5
0
ファイル: BumfManagementService.cs プロジェクト: JuRogn/OA
        //增
        public string DocTypeAdd(T_OA_SENDDOCTYPE obj)
        {

            using (BumfDocTypeManagementBll TypeBll = new BumfDocTypeManagementBll())
            {
                return TypeBll.AddDocTypeInfo(obj);
            }
        }
コード例 #6
0
ファイル: BumfManagementService.cs プロジェクト: JuRogn/OA
 //改
 public void DocTypeInfoUpdate(T_OA_SENDDOCTYPE obj)
 {
     using (BumfDocTypeManagementBll TypeBll = new BumfDocTypeManagementBll())
     {
         TypeBll.UpdateDocTypeInfo(obj);
     }
     
 }
コード例 #7
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: JuRogn/OA
 void DaGr_CurrentCellChanged(object sender, EventArgs e)
 {
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItem != null)
     {
         Senddoctype = (T_OA_SENDDOCTYPE)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体     
     }
 }
コード例 #8
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: jjg0519/OA
        void DaGr_CurrentCellChanged(object sender, EventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItem != null)
            {
                Senddoctype = (T_OA_SENDDOCTYPE)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体
            }
        }
コード例 #9
0
 public DocTypeForm(Action actionenum, T_OA_SENDDOCTYPE TypeObj)
 {
     InitializeComponent();
     //PARENT.Children.Add(loadbar);
     TypeClient.DocTypeAddCompleted        += new EventHandler <DocTypeAddCompletedEventArgs>(TypeClient_DocTypeAddCompleted);
     TypeClient.DocTypeInfoUpdateCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(TypeClient_DocTypeInfoUpdateCompleted);
     action       = actionenum;
     tmpDocTypeT  = TypeObj;
     this.Loaded += new RoutedEventHandler(DocTypeForm_Loaded);
 }
コード例 #10
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: jjg0519/OA
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
            DocTypeForm      AddWin  = new DocTypeForm(Action.Add, doctype);
            EntityBrowser    browser = new EntityBrowser(AddWin);

            browser.MinHeight        = 240;
            browser.MinWidth         = 600;
            browser.ReloadDataEvent += new EntityBrowser.refreshGridView(AddWin_ReloadDataEvent);
            browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
コード例 #11
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: jjg0519/OA
        private void DaGr_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItems.Count == 0)
            {
                return;
            }
            if (grid.SelectedItems.Count > 0)
            {
                Senddoctype = (T_OA_SENDDOCTYPE)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体
            }
        }
コード例 #12
0
ファイル: DocTypeForm.xaml.cs プロジェクト: JuRogn/OA
 public DocTypeForm(Action actionenum, T_OA_SENDDOCTYPE TypeObj)
 {
     InitializeComponent();
     //PARENT.Children.Add(loadbar);
     TypeClient.DocTypeAddCompleted += new EventHandler<DocTypeAddCompletedEventArgs>(TypeClient_DocTypeAddCompleted);
     TypeClient.DocTypeInfoUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(TypeClient_DocTypeInfoUpdateCompleted);
     action = actionenum;
     tmpDocTypeT = TypeObj;
     this.Loaded += new RoutedEventHandler(DocTypeForm_Loaded);
     
     
     
 }
コード例 #13
0
        //private SmtOACommonOfficeClient SendDocClient = new SmtOACommonOfficeClient();

        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        T_OA_SENDDOC senddoc = new T_OA_SENDDOC();
                        senddoc                       = e.Result;
                        tmpSendDoc                    = e.Result;
                        this.tbltitle.Text            = senddoc.SENDDOCTITLE;
                        this.tblsend.Text             = senddoc.SEND;
                        this.tblcopy.Text             = senddoc.CC;
                        tblcontent.RichTextBoxContext = senddoc.CONTENT;
                        this.tbldepartment.Text       = senddoc.DEPARTID;
                        SelectDocType                 = senddoc.T_OA_SENDDOCTYPE;
                        this.tbldoctype.Text          = SelectDocType.SENDDOCTYPE;
                        this.tblprioritity.Text       = senddoc.PRIORITIES;
                        this.tblgrade.Text            = senddoc.GRADED;
                        this.tblnum.Text              = senddoc.NUM;
                        personClient.GetEmployeeByIDAsync(senddoc.OWNERID);
                        this.tblcontenttitle.Text = senddoc.SENDDOCTITLE;
                        GetCompanyName(senddoc.OWNERCOMPANYID);
                        GetDepartmentName(senddoc.OWNERDEPARTMENTID);
                        string StrState = "";
                        string StrSave  = "";
                        tmpStrcbxGrade     = senddoc.GRADED;
                        tmpStrcbxProritity = senddoc.PRIORITIES;
                        if (senddoc.PUBLISHDATE != null)
                        {
                            //tbladddate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortDateString() + " " + System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortTimeString();
                            tbladddate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToString("d") + " " + System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortTimeString();
                        }

                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);
                        //ctrFile.IsEnabled = false;
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), e.Error.ToString());
                    return;
                }
            }
        }
コード例 #14
0
        void SendDocClient_GetDocTypeInfosCompleted(object sender, GetDocTypeInfosCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Result != null)
                {
                    this.cbxdoctype.Items.Clear();
                    T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
                    doctype.SENDDOCTYPE = "请选择";
                    e.Result.Insert(0, doctype);

                    this.cbxdoctype.ItemsSource       = e.Result;
                    this.cbxdoctype.DisplayMemberPath = "SENDDOCTYPE";
                    this.cbxdoctype.SelectedIndex     = 0;
                }
            }
        }
コード例 #15
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: jjg0519/OA
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (DaGr.SelectedItems.Count > 0)
            {
                string Result = "";
                DelInfosList = new ObservableCollection <string>();
                ComfirmWindow com = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    string StrTip = "";
                    for (int i = 0; i < DaGr.SelectedItems.Count; i++)
                    {
                        T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
                        doctype = DaGr.SelectedItems[i] as T_OA_SENDDOCTYPE;
                        if (!(SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(doctype, "OABUMFDOCTYPE", OperationType.Delete, Common.CurrentLoginUserInfo.EmployeeID)))
                        {
                            StrTip = "您不能删除您选中的第" + (i + 1).ToString() + "条,标题为" + doctype.SENDDOCTYPE + "的信息";
                            ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrTip, Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);

                            return;
                        }
                        string DocTypeID = "";
                        DocTypeID = (DaGr.SelectedItems[i] as T_OA_SENDDOCTYPE).SENDDOCTYPEID;
                        if (!(DelInfosList.IndexOf(DocTypeID) > -1))
                        {
                            DelInfosList.Add(DocTypeID);
                        }
                    }
                    if (DelInfosList.Count > 0)
                    {
                        BumfClient.DocTypeBatchDelAsync(DelInfosList);
                    }
                    else
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "删除记录不能为空", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    }
                };
                com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }
コード例 #16
0
ファイル: SendDocInfoForm.xaml.cs プロジェクト: JuRogn/OA
        private FormTypes actionTypes;//动作
        public SendDocInfoForm(V_BumfCompanySendDoc obj)
        {
            InitializeComponent();
            actionTypes = FormTypes.Browse;
            tmptype = obj.doctype;
            tmpSendDocT = obj.senddoc;
            //ctrFile.FileState = SMT.SaaS.FrameworkUI.FileUpload.Constants.FileStates.FileBrowse;
            //ctrFile.InitBtn(Visibility.Collapsed, Visibility.Collapsed);

            //ctrFile.SystemName = "OA";
            //ctrFile.ModelName = "CompanyDoc";
            //ctrFile.Load_fileData(obj.senddoc.SENDDOCID);
            //DetailSendClient.GetDocDistrbuteSingleInfoByIdCompleted += new EventHandler<GetDocDistrbuteSingleInfoByIdCompletedEventArgs>(DetailSendClient_GetDocDistrbuteSingleInfoByIdCompleted);
            DetailSendClient.GetSendDocSingleInfoByIdCompleted += new EventHandler<GetSendDocSingleInfoByIdCompletedEventArgs>(DetailSendClient_GetSendDocSingleInfoByIdCompleted);
            //GetSendDocDetailInfo(obj);

            tblcontent.HideControls();//屏蔽富文本框的头部
            DetailSendClient.GetSendDocSingleInfoByIdAsync(obj.OACompanySendDoc.SENDDOCID);
            this.Loaded += new RoutedEventHandler(SendDocInfoForm_Loaded);
        }
コード例 #17
0
        private FormTypes actionTypes;         //动作
        public SendDocInfoForm(V_BumfCompanySendDoc obj)
        {
            InitializeComponent();
            actionTypes = FormTypes.Browse;
            tmptype     = obj.doctype;
            tmpSendDocT = obj.senddoc;
            //ctrFile.FileState = SMT.SaaS.FrameworkUI.FileUpload.Constants.FileStates.FileBrowse;
            //ctrFile.InitBtn(Visibility.Collapsed, Visibility.Collapsed);

            //ctrFile.SystemName = "OA";
            //ctrFile.ModelName = "CompanyDoc";
            //ctrFile.Load_fileData(obj.senddoc.SENDDOCID);
            //DetailSendClient.GetDocDistrbuteSingleInfoByIdCompleted += new EventHandler<GetDocDistrbuteSingleInfoByIdCompletedEventArgs>(DetailSendClient_GetDocDistrbuteSingleInfoByIdCompleted);
            DetailSendClient.GetSendDocSingleInfoByIdCompleted += new EventHandler <GetSendDocSingleInfoByIdCompletedEventArgs>(DetailSendClient_GetSendDocSingleInfoByIdCompleted);
            //GetSendDocDetailInfo(obj);

            tblcontent.HideControls();//屏蔽富文本框的头部
            DetailSendClient.GetSendDocSingleInfoByIdAsync(obj.OACompanySendDoc.SENDDOCID);
            this.Loaded += new RoutedEventHandler(SendDocInfoForm_Loaded);
        }
コード例 #18
0
        private void GetDocTypeDetailInfo(T_OA_SENDDOCTYPE TypeObj)
        {
            this.txtDocType.Text = TypeObj.SENDDOCTYPE;
            this.txtDemo.Text    = TypeObj.REMARK;
            switch (TypeObj.OPTFLAG)
            {
            case "0":
                this.RbtNo.IsChecked  = true;
                this.rbtYes.IsChecked = false;
                break;

            case "1":
                this.RbtNo.IsChecked  = false;
                this.rbtYes.IsChecked = true;
                break;
            }
            tmpDocTypeT    = TypeObj;
            OldtmpDocTypeT = TypeObj;
            //loadbar.Stop();
            RefreshUI(RefreshedTypes.HideProgressBar);
        }
コード例 #19
0
 private void InitDocType(Action actionenum, T_OA_SENDDOCTYPE TypeObj)
 {
     //loadbar.Start();
     RefreshUI(RefreshedTypes.ShowProgressBar);
     if (actionenum == Action.Add)
     {
         RefreshUI(RefreshedTypes.HideProgressBar);
         //loadbar.Stop();
     }
     if (actionenum == Action.Edit)
     {
         this.txtDocType.IsEnabled = false;
         GetDocTypeDetailInfo(TypeObj);
     }
     if (actionenum == Action.Read)
     {
         this.txtDocType.IsEnabled = false;
         this.txtDemo.IsEnabled    = false;
         this.RbtNo.IsEnabled      = false;
         this.rbtYes.IsEnabled     = false;
         GetDocTypeDetailInfo(TypeObj);
     }
 }
コード例 #20
0
ファイル: PriviewSendDoc.xaml.cs プロジェクト: JuRogn/OA
        private string tmpStrcbxProritity = ""; //缓急
        //private SmtOACommonOfficeClient SendDocClient = new SmtOACommonOfficeClient();

        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        //T_OA_SENDDOC senddoc = new T_OA_SENDDOC();
                        senddoc = e.Result;
                        
                        this.tbltitle.Text = senddoc.SENDDOCTITLE;
                        this.tblsend.Text = senddoc.SEND;
                        this.tblcopy.Text = senddoc.CC;                        
                        tblcontent.RichTextBoxContext = senddoc.CONTENT;                        
                        this.tbldepartment.Text = senddoc.DEPARTID;
                        SelectDocType = senddoc.T_OA_SENDDOCTYPE;
                        this.tbldoctype.Text = SelectDocType.SENDDOCTYPE;
                        this.tblprioritity.Text = senddoc.PRIORITIES;
                        this.tblgrade.Text = senddoc.GRADED;
                        this.tblnum.Text = DocNum;//获取新的公文编号senddoc.NUM; 
                        this.tblcontenttitle.Text = senddoc.SENDDOCTITLE;
                        GetCompanyName(senddoc.OWNERCOMPANYID);
                        GetDepartmentName(senddoc.OWNERDEPARTMENTID);
                        string StrState = "";
                        string StrSave = "";                        
                        tmpStrcbxGrade = senddoc.GRADED;
                        tmpStrcbxProritity = senddoc.PRIORITIES;
                        string StrPublish = "";
                        if (!string.IsNullOrEmpty(senddoc.PUBLISHDATE.ToString()))
                        {
                            StrPublish = System.Convert.ToDateTime(senddoc.PUBLISHDATE.ToString()).ToShortDateString() + "印发";
                        }
                        if (!string.IsNullOrEmpty(senddoc.CREATEDATE.ToString()))
                        {
                            this.tbladddate.Text = System.Convert.ToDateTime(senddoc.CREATEDATE.ToString()).ToShortDateString().Replace("/","-");
                        }
                        //if (!ctrFile._files.HasAccessory)
                        //{
                        //    SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(GridInfo,16);
                        //}
                        this.tblKeyWord.Text = senddoc.KEYWORDS;
                        this.tblStatus.Text = "待发布";
                        tblPublishDate.Text = DocPublishDate;
                        //if (!string.IsNullOrEmpty(StrPublish))
                        //{
                        //    this.tblPublishDate.Text = DocPublishDate.Substring(0, 4) + "年" + DocPublishDate.Substring(5, 2) + "月" + DocPublishDate.Substring(8, 2) + "日印发";
                        //}
                        
                        
                        //ctrFile.IsEnabled = false;
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), e.Error.ToString());
                    return;
                }
            }

        }
コード例 #21
0
ファイル: CompanyDocWebPart.xaml.cs プロジェクト: jjg0519/OA
        //private SmtOACommonOfficeClient SendDocClient = new SmtOACommonOfficeClient();

        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {
            loadbar.Stop();
            //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        senddoc = e.Result;
                        publicClient.GetContentAsync(senddoc.SENDDOCID);
                        this.tbltitle.Text = string.IsNullOrEmpty(senddoc.SENDDOCTITLE) ? "":senddoc.SENDDOCTITLE;
                        this.tblsend.Text  = string.IsNullOrEmpty(senddoc.SEND) ? "":senddoc.SEND;
                        this.tblcopy.Text  = string.IsNullOrEmpty(senddoc.CC) ? "":senddoc.CC;
                        //tblcontent.Document = senddoc.CONTENT;
                        //this.tbldepartment.Text = senddoc.DEPARTID;
                        SelectDocType = senddoc.T_OA_SENDDOCTYPE;
                        if (SelectDocType != null)
                        {
                            this.tbldoctype.Text = SelectDocType.SENDDOCTYPE;
                        }
                        this.tblprioritity.Text = string.IsNullOrEmpty(senddoc.PRIORITIES) ? "":senddoc.PRIORITIES;
                        this.tblgrade.Text      = string.IsNullOrEmpty(senddoc.GRADED) ? "":senddoc.GRADED;
                        tblKeyWord.Text         = string.IsNullOrEmpty(senddoc.KEYWORDS) ? "":senddoc.KEYWORDS;
                        if (string.IsNullOrEmpty(DocNum))
                        {
                            this.tblnum.Text = senddoc.NUM;
                        }
                        else
                        {
                            this.tblnum.Text = DocNum;
                        }
                        this.tblcontenttitle.Text = senddoc.SENDDOCTITLE;

                        GetDepartmentName(senddoc.DEPARTID);
                        string StrState = "";
                        string StrSave  = "";
                        tmpStrcbxGrade     = senddoc.GRADED;
                        tmpStrcbxProritity = senddoc.PRIORITIES;
                        //if (!ctrFile._files.HasAccessory)
                        //{
                        //    SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 16);
                        //}
                        if (senddoc.ISREDDOC == "0")
                        {
                            SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 6);
                            SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 7);
                            SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 8);
                        }
                        if (senddoc.CREATEDATE != null)
                        {
                            //tbladddate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortDateString() + " " + System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortTimeString();
                            tbladddate.Text = System.Convert.ToDateTime(senddoc.CREATEDATE).ToShortDateString() + " " + System.Convert.ToDateTime(senddoc.CREATEDATE).ToShortTimeString();
                        }
                        if (string.IsNullOrEmpty(DocPublishDate))
                        {
                            this.tblPublishDate.Text = DocPublishDate;
                        }
                        else
                        {
                            if (senddoc.PUBLISHDATE != null)
                            {
                                this.tblPublishDate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToLongDateString() + "印发";
                                //StrPublish = dt.ToString("yyyymmdd");
                            }
                        }
                        if (senddoc.ISDISTRIBUTE == "1")
                        {
                            this.tblStatus.Text = "已发布";
                        }
                        else
                        {
                            this.tblStatus.Text = "未发布";
                        }
                        if (!string.IsNullOrEmpty(senddoc.OWNERNAME))
                        {
                            tbladduser.Text = senddoc.OWNERNAME;
                        }

                        //ctrFile.IsEnabled = false;
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), e.Error.ToString());
                    return;
                }
            }
        }
コード例 #22
0
        void SendDocClient_GetDocTypeInfosCompleted(object sender, GetDocTypeInfosCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Result != null)
                {
                    this.cbxdoctype.Items.Clear();
                    T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
                    doctype.SENDDOCTYPE = "请选择";
                    e.Result.Insert(0, doctype);

                    this.cbxdoctype.ItemsSource = e.Result;
                    this.cbxdoctype.DisplayMemberPath = "SENDDOCTYPE";
                    this.cbxdoctype.SelectedIndex = 0;
                    
                }
            }
        }
コード例 #23
0
        void LoadSendDocInfos(string checkState)
        {
            
            int pageCount = 0;
            string filter = "";    //查询过滤条件
            string StrTitle = ""; //标题
            string StrContent = "";//内容
            string StrStart = "";//添加文档的起始时间
            string StrEnd = "";//添加文档的结束时间
            string StrIsSave = "";//是否归档
            string StrDistrbute = "";//是否发布
            string StrGrade = "";//级别
            string StrProritity = "";//缓急
            string StrDocType = "";//文档类型
            bool IsNull = false;  //用来控制是否有查询条件
            ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //参数值
            //if (checkState != ((int)CheckStates.Approving).ToString())
            //{
            //    if (!string.IsNullOrEmpty(filter))
            //    {
            //        filter += " and ";
            //    }
            //    filter += "OACompanySendDoc.OWNERID==@" + paras.Count().ToString();
            //    paras.Add(Common.CurrentLoginUserInfo.EmployeeID);
            //}
            if (SearchUserID == Common.CurrentLoginUserInfo.EmployeeID)
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "( OWNERID =@" + paras.Count().ToString();
                paras.Add(SearchUserID);//员工ID值
                filter += " or ";
                filter += "CREATEUSERID =@" + paras.Count().ToString();//添加人的ID
                paras.Add(SearchUserID);
                filter += " ) ";
            }
            else
            {
                if (!string.IsNullOrEmpty(SearchUserID))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OWNERID =@" + paras.Count().ToString();
                    paras.Add(SearchUserID);
                }
            }

            
            if (IsQueryBtn)
            {
                T_SYS_DICTIONARY GradeObj = cbxGrade.SelectedItem as T_SYS_DICTIONARY;//级别
                T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY;//缓急
                T_OA_SENDDOCTYPE sendtype = new T_OA_SENDDOCTYPE();
                switch (cbxIsSave.SelectedIndex)
                { 
                    case 0:
                        break;
                    case 1:
                        StrIsSave = "0";
                        break;
                    case 2:
                        StrIsSave = "1";
                        break;

                }
                switch (cbxDistrbute.SelectedIndex)
                {
                    case 0:
                        break;
                    case 1:
                        StrDistrbute = "0";
                        break;
                    case 2:
                        StrDistrbute = "1";
                        break;

                }
                if (!string.IsNullOrEmpty(StrIsSave))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.ISSAVE =@" + paras.Count().ToString();//标题名称
                    paras.Add(StrIsSave);
                }
                if (!string.IsNullOrEmpty(StrDistrbute))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.ISDISTRIBUTE =@" + paras.Count().ToString();//标题名称
                    paras.Add(StrDistrbute);
                }
                
                StrTitle = this.txtSendDocTitle.Text.Trim().ToString();
                //StrContent = this.txtDocContent.Text.Trim().ToString();
                StrStart = this.dpStart.Text.Trim().ToString();
                StrEnd = this.dpEnd.Text.Trim().ToString();

                if (this.cbxGrade.SelectedIndex>0)
                {
                    StrGrade = GradeObj.DICTIONARYNAME.ToString();

                }
                if (this.cbxProritity.SelectedIndex >0)
                {
                    StrProritity = ProritityObj.DICTIONARYNAME.ToString();

                }
                if (this.cbxdoctype.SelectedIndex >0)
                {
                    sendtype = this.cbxdoctype.SelectedItem as T_OA_SENDDOCTYPE;
                    StrDocType = sendtype.SENDDOCTYPE;

                }
                if (!string.IsNullOrEmpty(StrTitle))
                {
                    IsNull = true;
                    //if (!string.IsNullOrEmpty(filter))
                    //{
                    //    filter += " and ";
                    //}
                    //filter += "OACompanySendDoc.SENDDOCTITLE ^@" + paras.Count().ToString();//标题名称
                    //paras.Add(StrTitle);

                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "@" + paras.Count().ToString() + ".Contains(OACompanySendDoc.SENDDOCTITLE) ";
                    paras.Add(StrTitle);
                }
                

                if (!string.IsNullOrEmpty(StrProritity))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.PRIORITIES ^@" + paras.Count().ToString();//缓急名称
                    paras.Add(StrProritity);
                }
                if (this.cbxdoctype.SelectedIndex >0)
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += " doctype.SENDDOCTYPE ==@" + paras.Count().ToString();
                    paras.Add(sendtype.SENDDOCTYPE);
                    
                }

                if (!string.IsNullOrEmpty(StrGrade))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.GRADED ^@" + paras.Count().ToString();//级别名称
                    paras.Add(StrGrade);
                }
                DateTime DtStart = new DateTime();
                DateTime DtEnd = new DateTime();
                if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("ENDTIMENOTNULL"));
                    return;
                }
                if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTNULL"));
                    return;
                }
                if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    DtStart = System.Convert.ToDateTime(StrStart);
                    DtEnd = System.Convert.ToDateTime(StrEnd + " 23:59:59");
                    if (DtStart > DtEnd)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME"));
                        return;
                    }
                    else
                    {
                        IsNull = true;
                        if (!string.IsNullOrEmpty(filter))
                        {
                            filter += " and ";
                        }
                        filter += "OACompanySendDoc.CREATEDATE >=@" + paras.Count().ToString();
                        paras.Add(DtStart);
                        if (!string.IsNullOrEmpty(filter))
                        {
                            filter += " and ";
                        }
                        filter += "OACompanySendDoc.CREATEDATE <=@" + paras.Count().ToString();
                        paras.Add(DtEnd);

                    }
                }
                //IsQueryBtn = false;
            }

            SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID = Common.CurrentLoginUserInfo.EmployeeID;
            loadbar.Start();
            SendDocClient.GetSendDocInfosListByWorkFlowAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE descending", filter, paras, pageCount, checkState, loginUserInfo);
            
            
        }
コード例 #24
0
ファイル: CompanyDocForm.xaml.cs プロジェクト: JuRogn/OA
 private void GetSendDocInfo(V_BumfCompanySendDoc VSend)
 {
     try
     {
         if (VSend.OACompanySendDoc != null)
         {
             tmpSendDocT = VSend.OACompanySendDoc;
             GetDepartmentNameByDepartmentID(tmpSendDocT.DEPARTID);
             this.txtZhuSend.Text = tmpSendDocT.SEND;
             this.txtChaoSend.Text = tmpSendDocT.CC;
             this.txtTel.Text = tmpSendDocT.TEL;
             this.txtTemplateTitle.Text = tmpSendDocT.SENDDOCTITLE;
             if (!string.IsNullOrEmpty(tmpSendDocT.NUM))
             {
                 this.txtNUM.Text = tmpSendDocT.NUM;
             }
             this.txtKey.Text = tmpSendDocT.KEYWORDS;
             //txtContent.RichTextBoxContext = tmpSendDocT.CONTENT;
             //txtContent.Document = tmpSendDocT.CONTENT;
             SelectDocType = VSend.doctype;
             //tmpStrcbxDocType = tmpSendDocT.T_OA_SENDDOCTYPE.SENDDOCTYPE;
             tmpStrcbxGrade = tmpSendDocT.GRADED;
             tmpStrcbxProritity = tmpSendDocT.PRIORITIES;
             if (!string.IsNullOrEmpty(tmpSendDocT.GRADED.ToString()))
             {
                 foreach (T_SYS_DICTIONARY Region in cbxGrade.Items)
                 {
                     if (Region.DICTIONARYNAME == tmpStrcbxGrade)
                     {
                         cbxGrade.SelectedItem = Region;
                         break;
                     }
                 }
             }
             if (!string.IsNullOrEmpty(tmpSendDocT.PRIORITIES.ToString()))
             {
                 foreach (T_SYS_DICTIONARY Region in cbxProritity.Items)
                 {
                     if (Region.DICTIONARYNAME == tmpStrcbxProritity)
                     {
                         cbxProritity.SelectedItem = Region;
                         break;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"),
             Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
     }
 }
コード例 #25
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: JuRogn/OA
 private void DaGr_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItems.Count == 0)
     {
         return;
     }
     if (grid.SelectedItems.Count > 0)
     {
         Senddoctype = (T_OA_SENDDOCTYPE)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体     
     }
 }
コード例 #26
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: JuRogn/OA
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {

            if (DaGr.SelectedItems.Count > 0)
            {

                string Result = "";
                DelInfosList = new ObservableCollection<string>();
                ComfirmWindow com = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    string StrTip = "";
                    for (int i = 0; i < DaGr.SelectedItems.Count; i++)
                    {
                        T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
                        doctype =DaGr.SelectedItems[i] as T_OA_SENDDOCTYPE;
                        if (!(SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(doctype, "OABUMFDOCTYPE", OperationType.Delete, Common.CurrentLoginUserInfo.EmployeeID)))
                        {
                            StrTip = "您不能删除您选中的第" + (i + 1).ToString() + "条,标题为" + doctype.SENDDOCTYPE + "的信息";
                            ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrTip, Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);

                            return;
                        }
                        string DocTypeID = "";
                        DocTypeID = (DaGr.SelectedItems[i] as T_OA_SENDDOCTYPE).SENDDOCTYPEID;
                        if (!(DelInfosList.IndexOf(DocTypeID) > -1))
                        {
                            DelInfosList.Add(DocTypeID);
                        }
                    }      
                    if(DelInfosList.Count >0)
                        BumfClient.DocTypeBatchDelAsync(DelInfosList);
                    else
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "删除记录不能为空", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);

                };
                com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            } 
        }
コード例 #27
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: jjg0519/OA
 void btnRefresh_Click(object sender, RoutedEventArgs e)
 {
     Senddoctype = null;//刷新将选择对象置空
     LoadDocTypeInfos();
 }
コード例 #28
0
ファイル: CompanyDocForm.xaml.cs プロジェクト: JuRogn/OA
        private void InitMethodForManage(FormTypes operationType, V_BumfCompanySendDoc TypeObj)
        {
            //if (operationType == FormTypes.Audit || operationType == FormTypes.Browse)
            //{
            //    ctrFile.FileState = SMT.SaaS.FrameworkUI.FileUpload.Constants.FileStates.FileBrowse;
            //}
            //ctrFile.SystemName = "OA";
            //ctrFile.ModelName = "CompanyDoc";
            //ctrFile.InitBtn(Visibility.Visible, Visibility.Collapsed);
            //ctrFile.EntityEditor = this;

            //ctrFile.Event_AllFilesFinished += new EventHandler<FileCountEventArgs>(Event_AllFilesFinished);
            if (operationType == FormTypes.New)
            {
                tmpSendDocT.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
                //SVAudit.Visibility = Visibility.Collapsed;
                if (!string.IsNullOrEmpty(Common.CurrentLoginUserInfo.Telphone))
                {
                    this.txtTel.Text = Common.CurrentLoginUserInfo.Telphone;
                }
                tmpSendDocT.SENDDOCID = System.Guid.NewGuid().ToString();
                Utility.InitFileLoad("CompanyDoc", tmpSendDocT.SENDDOCID, operationType, uploadFile);
                InitComboxSource();
                //this.cbxGrade.SelectedIndex = 0;
                //this.cbxProritity.SelectedIndex = 0;

                //获取电话号码(固话优先,手机次之)
                personClient.GetEmployeeDetailByIDCompleted += (o, e) =>
                {
                    if (e.Result != null && e.Result.T_HR_EMPLOYEE != null)
                    {
                        if (e.Result.T_HR_EMPLOYEE.MOBILE!=null)
                        {
                            this.txtTel.Text = e.Result.T_HR_EMPLOYEE.MOBILE;
                        }
                        if (e.Result.T_HR_EMPLOYEE.OFFICEPHONE != null)
                        {
                            this.txtTel.Text = e.Result.T_HR_EMPLOYEE.OFFICEPHONE;
                        }
                    }
                };
                personClient.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID);
                //personClient.GetEmployeePostBriefByEmployeeIDAsync(Common.CurrentLoginUserInfo.EmployeeID);
                InitUserInfo();
                StrDepartmentID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                StrSendDepartment = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName;
                PostsObject.Text = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName;
                tmpSendDocT.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;
                tmpSendDocT.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                tmpSendDocT.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                tmpSendDocT.OWNERDEPARTMENTID = StrDepartmentID;
                StrSendDepartment = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName;
                tmpSendDocT.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                string filter = "";
                tmpIsRed = "否";
                SendDocClient.GetCompanyDocNumsByUseridAsync(Common.CurrentLoginUserInfo.EmployeeID, "CREATEDATE", filter);
            }
            else
            {
                publicClient.GetContentAsync(TypeObj.OACompanySendDoc.SENDDOCID);
                SendDocClient.GetSendDocSingleInfoByIdAsync(TypeObj.OACompanySendDoc.SENDDOCID);
                //tmpSendDocT = TypeObj.OACompanySendDoc;
              
                SelectChange = false;
                Utility.InitFileLoad("CompanyDoc", TypeObj.OACompanySendDoc.SENDDOCID, operationType, uploadFile);
                if (operationType == FormTypes.Edit || operationType == FormTypes.Resubmit)
                {
                    SelectDocType = TypeObj.doctype;
                    tmpSendDocT.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
                    //GetSendDocInfo(TypeObj);
                    //InitComboxSource();
                    //RefreshUI(RefreshedTypes.AuditInfo);
                    //RefreshUI(RefreshedTypes.All);

                    //InitAudit(TypeObj.OACompanySendDoc);
                }
                if (operationType == FormTypes.Audit)
                {
                    SelectDocType = TypeObj.doctype;

                    SetReadOnly();
                   
                }

            }
        }
コード例 #29
0
ファイル: CompanyDocForm.xaml.cs プロジェクト: JuRogn/OA
        private void cbxDocType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (SelectChange)
            {
                if (cbxDocType.SelectedItem == null)
                {
                    return;
                }
                else
                {
                    T_OA_SENDDOCTYPE DocType = new T_OA_SENDDOCTYPE();
                    DocType = cbxDocType.SelectedItem as T_OA_SENDDOCTYPE;
                    string StrType = DocType.SENDDOCTYPE.ToString();

                    SendDocClient.GetDocTypeTemplateContentByDocTypeAsync(StrType);
                }
            }
            else
            {
                SelectChange = true;
            }
        }
コード例 #30
0
ファイル: CompanyDocForm.xaml.cs プロジェクト: JuRogn/OA
        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {

            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        T_OA_SENDDOC senddoc = new T_OA_SENDDOC();
                        senddoc = e.Result; 
                        tmpSendDocT = senddoc;
                        ShowDistributButton();
                        //HideDistributeButton();
                        if (tmpSendDocT.ISREDDOC == "0")
                        {
                            tmpIsRed = "否";
                        }
                        else
                        {
                            tmpIsRed = "是";
                        }
                        //personClient.getemployee
                        personClient.GetEmployeePostBriefByEmployeeIDAsync(tmpSendDocT.OWNERID);
                        //personClient.GetEmployeeDetailByIDAsync(tmpSendDocT.OWNERID);
                        GetDepartmentNameByDepartmentID(tmpSendDocT.DEPARTID);
                        this.txtZhuSend.Text = string.IsNullOrEmpty(tmpSendDocT.SEND) ? "" : tmpSendDocT.SEND;
                        this.txtChaoSend.Text = string.IsNullOrEmpty(tmpSendDocT.CC) ? "" : tmpSendDocT.CC;
                        if (!string.IsNullOrEmpty(tmpSendDocT.TEL))
                        {
                            this.txtTel.Text = tmpSendDocT.TEL;
                        }
                        this.txtTemplateTitle.Text = string.IsNullOrEmpty(tmpSendDocT.SENDDOCTITLE) ? "" : tmpSendDocT.SENDDOCTITLE;
                        this.txtNUM.Text = string.IsNullOrEmpty(tmpSendDocT.NUM) ? "" : tmpSendDocT.NUM;
                        if (tmpSendDocT.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString()
                    || tmpSendDocT.CHECKSTATE == Convert.ToInt32(CheckStates.UnApproved).ToString())
                        {
                            RefreshUI(RefreshedTypes.All);
                        }
                        switch (tmpSendDocT.ISREDDOC)
                        {
                            case "0":
                                this.RbtNo.IsChecked = true;
                                this.rbtYes.IsChecked = false;
                                break;
                            case "1":
                                this.RbtNo.IsChecked = false;
                                this.rbtYes.IsChecked = true;
                                break;
                        }

                        this.txtKey.Text = string.IsNullOrEmpty(tmpSendDocT.KEYWORDS) ? "" : tmpSendDocT.KEYWORDS;

                        //txtContent.RichTextBoxContext = tmpSendDocT.CONTENT;
                        //txtContent.Document = tmpSendDocT.CONTENT;
                        SelectDocType = senddoc.T_OA_SENDDOCTYPE;
                        //tmpStrcbxDocType = tmpSendDocT.T_OA_SENDDOCTYPE.SENDDOCTYPE;
                        tmpStrcbxGrade = tmpSendDocT.GRADED;
                        tmpGrade = tmpStrcbxGrade;
                        tmpStrcbxProritity = tmpSendDocT.PRIORITIES;
                        tmpProri = tmpStrcbxProritity;
                        if (!string.IsNullOrEmpty(tmpSendDocT.GRADED.ToString()))
                        {
                            foreach (T_SYS_DICTIONARY Region in cbxGrade.Items)
                            {
                                if (Region.DICTIONARYNAME == tmpStrcbxGrade)
                                {
                                    cbxGrade.SelectedItem = Region;
                                    break;
                                }
                            }
                        }
                        if (!string.IsNullOrEmpty(tmpSendDocT.PRIORITIES.ToString()))
                        {
                            foreach (T_SYS_DICTIONARY Region in cbxProritity.Items)
                            {
                                if (Region.DICTIONARYNAME == tmpStrcbxProritity)
                                {
                                    cbxProritity.SelectedItem = Region;
                                    break;
                                }
                            }
                        }
                        InitComboxSource();
                        if (action == FormTypes.Audit)
                        {
                            
                        }
                        if (action == FormTypes.Resubmit)
                        {
                            tmpSendDocT.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
                        }
                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);

                        //if (IsMainUser)
                        //{


                        //    IsMainUser = false;
                        //}


                        //InitAudit(senddoc);
                    }
                }
                else
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
            }

        }
コード例 #31
0
ファイル: AuditCompanyDocForm.xaml.cs プロジェクト: JuRogn/OA
        //private SmtOACommonOfficeClient SendDocClient = new SmtOACommonOfficeClient();

        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        T_OA_SENDDOC senddoc = new T_OA_SENDDOC();
                        senddoc = e.Result;
                        tmpSendDoc = e.Result;
                        this.tbltitle.Text = senddoc.SENDDOCTITLE;
                        this.tblsend.Text = senddoc.SEND;
                        this.tblcopy.Text = senddoc.CC;                        
                        tblcontent.RichTextBoxContext = senddoc.CONTENT;                        
                        this.tbldepartment.Text = senddoc.DEPARTID;
                        SelectDocType = senddoc.T_OA_SENDDOCTYPE;
                        this.tbldoctype.Text = SelectDocType.SENDDOCTYPE;
                        this.tblprioritity.Text = senddoc.PRIORITIES;
                        this.tblgrade.Text = senddoc.GRADED;                        
                        this.tblnum.Text = senddoc.NUM;
                        personClient.GetEmployeeByIDAsync(senddoc.OWNERID);
                        this.tblcontenttitle.Text = senddoc.SENDDOCTITLE;
                        GetCompanyName(senddoc.OWNERCOMPANYID);
                        GetDepartmentName(senddoc.OWNERDEPARTMENTID);
                        string StrState = "";
                        string StrSave = "";                        
                        tmpStrcbxGrade = senddoc.GRADED;
                        tmpStrcbxProritity = senddoc.PRIORITIES;
                        if (senddoc.PUBLISHDATE !=null)
                        {
                            //tbladddate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortDateString() + " " + System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortTimeString();
                            tbladddate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToString("d") + " " + System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortTimeString();
                        }
                        
                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);
                        //ctrFile.IsEnabled = false;
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), e.Error.ToString());
                    return;
                }
            }

        }
コード例 #32
0
ファイル: EngineServices.svc.cs プロジェクト: JuRogn/OA
        /// <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;

            }

        }
コード例 #33
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: JuRogn/OA
 void btnRefresh_Click(object sender, RoutedEventArgs e)
 {
     Senddoctype = null;//刷新将选择对象置空
     LoadDocTypeInfos();
 }
コード例 #34
0
ファイル: DocTypeManagement.xaml.cs プロジェクト: JuRogn/OA
 private void btnNew_Click(object sender, RoutedEventArgs e)
 {
     T_OA_SENDDOCTYPE doctype = new T_OA_SENDDOCTYPE();
     DocTypeForm AddWin = new DocTypeForm(Action.Add, doctype);
     EntityBrowser browser = new EntityBrowser(AddWin);
     browser.MinHeight = 240;
     browser.MinWidth = 600;
     browser.ReloadDataEvent += new EntityBrowser.refreshGridView(AddWin_ReloadDataEvent);
     browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
 }
コード例 #35
0
ファイル: MyCompanyDoc.xaml.cs プロジェクト: JuRogn/OA
        void LoadSendDocInfos()
        {
            int pageCount = 0;
            string filter = "";    //查询过滤条件
            string StrTitle = ""; //标题
            
            string StrStart = "";//添加文档的起始时间
            string StrEnd = "";//添加文档的结束时间
            string StrIsSave = "";//是否归档
            string StrDistrbute = "";//是否发布
            string StrGrade = "";//级别
            string StrProritity = "";//缓急
            string StrDocType = "";//文档类型
            bool IsNull = false;  //用来控制是否有查询条件
            
            ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //参数值
            //if (checkState != ((int)CheckStates.Approving).ToString())
            //{
            //    if (!string.IsNullOrEmpty(filter))
            //    {
            //        filter += " and ";
            //    }
            //    filter += "OACompanySendDoc.OWNERID==@" + paras.Count().ToString();
            //    paras.Add(Common.CurrentLoginUserInfo.EmployeeID);
            //}
            if (IsQueryBtn)
            {
                StrTitle = this.txtSendDocTitle.Text.Trim().ToString();
                T_SYS_DICTIONARY GradeObj = cbxGrade.SelectedItem as T_SYS_DICTIONARY;//级别
                T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY;//缓急
                T_OA_SENDDOCTYPE DocType = new T_OA_SENDDOCTYPE();
                StrStart = this.dpStart.Text.Trim().ToString();
                StrEnd = this.dpEnd.Text.Trim().ToString();
                
                if (this.cbxdoctype.SelectedIndex >0)
                {
                    StrDocType = this.cbxdoctype.SelectedItem.ToString();
                    DocType = this.cbxdoctype.SelectedItem as T_OA_SENDDOCTYPE;
                    
                }

                if (this.cbxGrade.SelectedIndex>0)
                {
                    StrGrade = GradeObj.DICTIONARYNAME.ToString();
                }
                if (this.cbxProritity.SelectedIndex > 0)
                {
                    StrProritity = ProritityObj.DICTIONARYNAME.ToString();
                }
                if (!string.IsNullOrEmpty(StrTitle))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.SENDDOCTITLE ^@" + paras.Count().ToString();//标题名称
                    paras.Add(StrTitle);
                }
                
                if (!string.IsNullOrEmpty(StrProritity))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.PRIORITIES ==@" + paras.Count().ToString();//缓急名称
                    paras.Add(StrProritity);
                }
                if (!string.IsNullOrEmpty(StrDocType))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "doctype.SENDDOCTYPEID ==@" + paras.Count().ToString();//类型名称
                    paras.Add(DocType.SENDDOCTYPEID);
                }

                if (!string.IsNullOrEmpty(StrGrade))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.GRADED ==@" + paras.Count().ToString();//级别名称
                    paras.Add(StrGrade);
                }
                DateTime DtStart = new DateTime();
                DateTime DtEnd = new DateTime();
                if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("ENDTIMENOTNULL"));
                    return;
                }
                if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTNULL"));
                    return;
                }
                if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    DtStart = System.Convert.ToDateTime(StrStart);
                    DtEnd = System.Convert.ToDateTime(StrEnd + " 23:59:59");
                    if (DtStart > DtEnd)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME"));
                        return;
                    }
                    else
                    {
                        IsNull = true;
                    }
                }
            }

            SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID = Common.CurrentLoginUserInfo.EmployeeID;
            loginUserInfo.postID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            loginUserInfo.departmentID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            loadbar.Start();            
            //SendDocClient.GetSendDocInfosListByWorkFlowAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE", filter, paras, pageCount, checkState, loginUserInfo);
            SendDocClient.GetMYSendDocInfosListAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE", filter, paras, pageCount, "2", loginUserInfo);
            
        }
コード例 #36
0
ファイル: DocTypeForm.xaml.cs プロジェクト: JuRogn/OA
 private void GetDocTypeDetailInfo(T_OA_SENDDOCTYPE TypeObj)
 {
     this.txtDocType.Text = TypeObj.SENDDOCTYPE;
     this.txtDemo.Text = TypeObj.REMARK;
     switch (TypeObj.OPTFLAG)
     { 
         case "0":
             this.RbtNo.IsChecked = true;
             this.rbtYes.IsChecked = false;
             break;
         case "1":
             this.RbtNo.IsChecked = false;
             this.rbtYes.IsChecked = true;
             break;
     }
     tmpDocTypeT = TypeObj;
     OldtmpDocTypeT = TypeObj;
     //loadbar.Stop();
     RefreshUI(RefreshedTypes.HideProgressBar);
 }
コード例 #37
0
        void LoadSendDocInfos()
        {
            int    pageCount = 0;
            string filter    = "";                                                                                    //查询过滤条件
            string StrTitle  = "";                                                                                    //标题

            string StrStart     = "";                                                                                 //添加文档的起始时间
            string StrEnd       = "";                                                                                 //添加文档的结束时间
            string StrIsSave    = "";                                                                                 //是否归档
            string StrDistrbute = "";                                                                                 //是否发布
            string StrGrade     = "";                                                                                 //级别
            string StrProritity = "";                                                                                 //缓急
            string StrDocType   = "";                                                                                 //文档类型
            bool   IsNull       = false;                                                                              //用来控制是否有查询条件

            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值

            //if (checkState != ((int)CheckStates.Approving).ToString())
            //{
            //    if (!string.IsNullOrEmpty(filter))
            //    {
            //        filter += " and ";
            //    }
            //    filter += "OACompanySendDoc.OWNERID==@" + paras.Count().ToString();
            //    paras.Add(Common.CurrentLoginUserInfo.EmployeeID);
            //}
            if (IsQueryBtn)
            {
                StrTitle = this.txtSendDocTitle.Text.Trim().ToString();
                T_SYS_DICTIONARY GradeObj     = cbxGrade.SelectedItem as T_SYS_DICTIONARY;     //级别
                T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY; //缓急
                T_OA_SENDDOCTYPE DocType      = new T_OA_SENDDOCTYPE();
                StrStart = this.dpStart.Text.Trim().ToString();
                StrEnd   = this.dpEnd.Text.Trim().ToString();

                if (this.cbxdoctype.SelectedIndex > 0)
                {
                    StrDocType = this.cbxdoctype.SelectedItem.ToString();
                    DocType    = this.cbxdoctype.SelectedItem as T_OA_SENDDOCTYPE;
                }

                if (this.cbxGrade.SelectedIndex > 0)
                {
                    StrGrade = GradeObj.DICTIONARYNAME.ToString();
                }
                if (this.cbxProritity.SelectedIndex > 0)
                {
                    StrProritity = ProritityObj.DICTIONARYNAME.ToString();
                }
                if (!string.IsNullOrEmpty(StrTitle))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.SENDDOCTITLE ^@" + paras.Count().ToString();//标题名称
                    paras.Add(StrTitle);
                }

                if (!string.IsNullOrEmpty(StrProritity))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.PRIORITIES ==@" + paras.Count().ToString();//缓急名称
                    paras.Add(StrProritity);
                }
                if (!string.IsNullOrEmpty(StrDocType))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "doctype.SENDDOCTYPEID ==@" + paras.Count().ToString();//类型名称
                    paras.Add(DocType.SENDDOCTYPEID);
                }

                if (!string.IsNullOrEmpty(StrGrade))
                {
                    IsNull = true;
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += "OACompanySendDoc.GRADED ==@" + paras.Count().ToString();//级别名称
                    paras.Add(StrGrade);
                }
                DateTime DtStart = new DateTime();
                DateTime DtEnd   = new DateTime();
                if (!string.IsNullOrEmpty(StrStart) && string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("ENDTIMENOTNULL"));
                    return;
                }
                if (string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTNULL"));
                    return;
                }
                if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
                {
                    DtStart = System.Convert.ToDateTime(StrStart);
                    DtEnd   = System.Convert.ToDateTime(StrEnd + " 23:59:59");
                    if (DtStart > DtEnd)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("dtSearch"), Utility.GetResourceStr("STARTTIMENOTGREATENDTIME"));
                        return;
                    }
                    else
                    {
                        IsNull = true;
                    }
                }
            }

            SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo loginUserInfo = new SMT.SaaS.OA.UI.SmtOACommonOfficeService.LoginUserInfo();
            loginUserInfo.companyID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID       = Common.CurrentLoginUserInfo.EmployeeID;
            loginUserInfo.postID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            loginUserInfo.departmentID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            loadbar.Start();
            //SendDocClient.GetSendDocInfosListByWorkFlowAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE", filter, paras, pageCount, checkState, loginUserInfo);
            SendDocClient.GetMYSendDocInfosListAsync(dataPager.PageIndex, dataPager.PageSize, "OACompanySendDoc.CREATEDATE", filter, paras, pageCount, "2", loginUserInfo);
        }
コード例 #38
0
ファイル: CompanyDocWebPart.xaml.cs プロジェクト: JuRogn/OA
        //private SmtOACommonOfficeClient SendDocClient = new SmtOACommonOfficeClient();

        void SendDocClient_GetSendDocSingleInfoByIdCompleted(object sender, GetSendDocSingleInfoByIdCompletedEventArgs e)
        {
            loadbar.Stop();
            //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈
            if (!e.Cancelled)
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        
                        senddoc = e.Result;
                        publicClient.GetContentAsync(senddoc.SENDDOCID);
                        this.tbltitle.Text = string.IsNullOrEmpty(senddoc.SENDDOCTITLE) ? "":senddoc.SENDDOCTITLE;
                        this.tblsend.Text = string.IsNullOrEmpty( senddoc.SEND) ? "":senddoc.SEND;
                        this.tblcopy.Text =string.IsNullOrEmpty( senddoc.CC) ? "":senddoc.CC;                        
                        //tblcontent.Document = senddoc.CONTENT;                        
                        //this.tbldepartment.Text = senddoc.DEPARTID;
                        SelectDocType = senddoc.T_OA_SENDDOCTYPE;
                        if (SelectDocType != null)
                        {
                            this.tbldoctype.Text = SelectDocType.SENDDOCTYPE;
                        }
                        this.tblprioritity.Text =string.IsNullOrEmpty( senddoc.PRIORITIES) ? "":senddoc.PRIORITIES;
                        this.tblgrade.Text = string.IsNullOrEmpty(senddoc.GRADED) ? "":senddoc.GRADED;
                        tblKeyWord.Text = string.IsNullOrEmpty(senddoc.KEYWORDS) ? "":senddoc.KEYWORDS;
                        if (string.IsNullOrEmpty(DocNum))
                        {
                            this.tblnum.Text = senddoc.NUM;
                        }
                        else
                        {
                            this.tblnum.Text = DocNum;
                        }
                        this.tblcontenttitle.Text = senddoc.SENDDOCTITLE;
                        
                        GetDepartmentName(senddoc.DEPARTID);
                        string StrState = "";
                        string StrSave = "";                        
                        tmpStrcbxGrade = senddoc.GRADED;
                        tmpStrcbxProritity = senddoc.PRIORITIES;
                        //if (!ctrFile._files.HasAccessory)
                        //{
                        //    SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 16);
                        //}
                        if (senddoc.ISREDDOC == "0")
                        {
                            SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 6);
                            SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 7);
                            SMT.SaaS.FrameworkUI.Common.Utility.HiddenGridRow(this.GridInfo, 8);
                        }
                        if (senddoc.CREATEDATE !=null)
                        {
                            //tbladddate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortDateString() + " " + System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToShortTimeString();
                            tbladddate.Text = System.Convert.ToDateTime(senddoc.CREATEDATE).ToShortDateString() + " " + System.Convert.ToDateTime(senddoc.CREATEDATE).ToShortTimeString();
                        }
                        if (string.IsNullOrEmpty(DocPublishDate))
                        {
                           this.tblPublishDate.Text = DocPublishDate;
                        }
                        else
                        {
                            if (senddoc.PUBLISHDATE != null)
                            {
                                this.tblPublishDate.Text = System.Convert.ToDateTime(senddoc.PUBLISHDATE).ToLongDateString() + "印发";
                                //StrPublish = dt.ToString("yyyymmdd"); 
                            }
                        }
                        if (senddoc.ISDISTRIBUTE == "1")
                        {
                            this.tblStatus.Text = "已发布";
                        }
                        else
                        {
                            this.tblStatus.Text = "未发布";
                        }
                        if (!string.IsNullOrEmpty(senddoc.OWNERNAME))
                        {
                            tbladduser.Text = senddoc.OWNERNAME;
                        }
                        
                        //ctrFile.IsEnabled = false;
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), e.Error.ToString());
                    return;
                }
            }

        }
コード例 #39
0
ファイル: CompanyDocForm.xaml.cs プロジェクト: JuRogn/OA
        private void SaveSendDocInfo()
        {
            RefreshUI(RefreshedTypes.ShowProgressBar);
            string StrTitle = ""; //标题
            string StrNum = ""; //模板名
            string StrGrade = "";//级别

            string StrProritity = "";//缓急
            byte[] StrContent;//内容

            string StrSender = "";  //主送人
            string CopySender = "";//抄送人
            string StrTel = ""; //联系电话
            string StrKey = ""; //关键字
            T_SYS_DICTIONARY GradeObj = cbxGrade.SelectedItem as T_SYS_DICTIONARY;//级别
            T_SYS_DICTIONARY ProritityObj = cbxProritity.SelectedItem as T_SYS_DICTIONARY;//缓急
            StrTitle = this.txtTemplateTitle.Text.Trim().ToString();
            StrNum = this.txtNUM.Text.Trim().ToString();
            if (this.cbxGrade.SelectedIndex == 0 || this.cbxGrade.SelectedIndex == -1)
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCGRADENOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                this.cbxGrade.Focus();
                return;
            }
            if (this.cbxProritity.SelectedIndex == 0 || this.cbxProritity.SelectedIndex == -1)
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCPRIORITYNOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                this.cbxProritity.Focus();
                return;
            }
            StrGrade = GradeObj.DICTIONARYNAME.ToString();
            tmpGrade = StrGrade;
            StrProritity = ProritityObj.DICTIONARYNAME.ToString();
            tmpProri = StrProritity;
            StrKey = this.txtKey.Text.Trim().ToString();
            //Strtype = this.cbxDocType.SelectedItem.ToString();
            if (this.cbxDocType.SelectedIndex > -1)
            {
                SelectDocType = this.cbxDocType.SelectedItem as T_OA_SENDDOCTYPE;
            }
            else
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCTYPENOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                this.cbxDocType.Focus();
                return;
            }
            //StrContent = txtContent.RichTextBoxContext;
            try
            {
                StrContent = txtContent.Document;
            }
            catch (Exception ex)
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCCONTEXTERR"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                return;
            }
            CopySender = this.txtChaoSend.Text.Trim().ToString();
            StrSender = this.txtZhuSend.Text.Trim().ToString();
            StrTel = this.txtTel.Text.Trim().ToString();
            //if (!string.IsNullOrEmpty(StrTel))
            //{
            //    string StrRex = @"((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)";
            //    Regex regex = new Regex(StrRex);
            //    if (!regex.IsMatch(StrTel))
            //    {
            //        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "请输入",
            //        Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            //        this.cbxDocType.Focus();
            //        return;
            //    }
            //}
            if (string.IsNullOrEmpty(StrTitle))
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCTITLENOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                this.txtTemplateTitle.Focus();
                return;

            }
            string StrFlag = "";

            if (this.rbtYes.IsChecked == true)
            {
                StrFlag = "1";
                tmpIsRed = "是";
                if (string.IsNullOrEmpty(StrKey))
                {
                    BackToSubmit();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("KEYWORDSNOTNULL"),
                        Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    this.txtKey.Focus();
                    return;
                }
            }
            if (this.RbtNo.IsChecked == true)
            {
                StrFlag = "0";
                tmpIsRed = "否";
            }

            if (StrContent != null)
            {
                if (StrContent.Length == 0)
                {
                    BackToSubmit();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCCONTENTNOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    this.txtContent.Focus();
                    return;

                }
            }
            else
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SENDDOCCONTENTNOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                this.txtContent.Focus();
            }


            if (!string.IsNullOrEmpty(StrNum))
            {
                bool IsCheck = true;
                if (!((StrNum.IndexOf('[') > 0 && StrNum.IndexOf(']') > 0) || (StrNum.IndexOf('【') > 0 && StrNum.IndexOf('】') > 0)))
                {
                    IsCheck = false;
                }
                if (StrNum.Substring(StrNum.Length - 1, 1) != "号")
                {
                    IsCheck = false;
                }

                if (!IsCheck)
                {
                    BackToSubmit();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "公文编号格式不对,请参考集团本部人力[2011]01号或集团本部人力【2011】01号",
                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    return;
                }
                int IntStart = -1;
                int IntEnd = -1;
                string StrYear = "";//[]里的数字

                //int IntLastChar=-1;//“号”所处的位置
                if (StrNum.IndexOf(']') > 0)//英文状态下的]
                {
                    IntEnd = StrNum.IndexOf(']');
                }
                if (StrNum.IndexOf('】') > 0)//中文下半角]
                {
                    IntEnd = StrNum.IndexOf('】');
                }
                if (StrNum.IndexOf('[') > 0)//英文状态下的[
                {
                    IntStart = StrNum.IndexOf('[');
                }
                if (StrNum.IndexOf('【') > 0)//中文下半角【
                {
                    IntStart = StrNum.IndexOf('【');
                }
                StrYear = StrNum.Substring(IntStart + 1, IntEnd - IntStart - 1);
                if (StrYear != DateTime.Now.Year.ToString())
                {
                    BackToSubmit();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "公文编号格式不对,[]或【】里面应该为当前年份如:【2011】",
                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    return;
                }



            }
            if (string.IsNullOrEmpty(StrDepartmentID))
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("DEPARTMENTNOTNULL"),
                    Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                return;
            }


            if (CheckCompanyDco())
            {

                if (action == FormTypes.New)
                {
                    
                    tmpSendDocT.GRADED = StrGrade;
                    tmpSendDocT.PRIORITIES = StrProritity;
                    tmpSendDocT.SENDDOCTITLE = StrTitle;
                    tmpSendDocT.SEND = StrSender;
                    tmpSendDocT.CC = CopySender;
                    tmpSendDocT.ISREDDOC = StrFlag;
                    tmpSendDocT.T_OA_SENDDOCTYPE = SelectDocType;

                    tmpSendDocT.CONTENT = StrContent;
                    tmpSendDocT.DEPARTID = StrDepartmentID;
                    tmpSendDocT.NUM = StrNum;
                    tmpSendDocT.KEYWORDS = StrKey;

                    tmpSendDocT.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    tmpSendDocT.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    tmpSendDocT.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                    tmpSendDocT.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    tmpSendDocT.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                    tmpSendDocT.TEL = StrTel;
                    tmpSendDocT.UPDATEUSERNAME = "";
                    tmpSendDocT.UPDATEDATE = null;
                    tmpSendDocT.UPDATEUSERID = "";

                    tmpSendDocT.ISDISTRIBUTE = "0";
                    tmpSendDocT.ISSAVE = "0";

                    //tmpSendDocT.CREATEDATE = System.DateTime.Now;
                    tmpSendDocT.CHECKSTATE = "0";
                    tempStrSendDocName = StrTitle;

                    SendDocClient.SendDocAddAsync(tmpSendDocT, "Add");
                }
                if (action == FormTypes.Edit || action == FormTypes.Resubmit)
                {
                    tmpSendDocT.GRADED = StrGrade;
                    tmpSendDocT.PRIORITIES = StrProritity;
                    tmpSendDocT.SENDDOCTITLE = StrTitle;
                    tmpSendDocT.SEND = StrSender;
                    tmpSendDocT.CC = CopySender;
                    tmpSendDocT.ISREDDOC = StrFlag;
                    //tmpSendDocT.T_OA_SENDDOCTYPEReference = new EntityReferenceOfT_OA_SENDDOCTYPEUlJdEHjk();

                    //tmpSendDocT.T_OA_SENDDOCTYPEReference.EntityKey = SelectDocType.EntityKey;
                    tmpSendDocT.T_OA_SENDDOCTYPE = SelectDocType;
                    //tmpSendDocT.T_OA_SENDDOCTYPE.SENDDOCTYPE = SelectDocType.SENDDOCTYPE;
                    tmpSendDocT.CHECKSTATE = "0";
                    //tmpSendDocT.CONTENT = txtContent.RichTextBoxContext;
                    tmpSendDocT.CONTENT = txtContent.Document;
                    tmpSendDocT.DEPARTID = StrDepartmentID;
                    tmpSendDocT.NUM = StrNum;
                    tmpSendDocT.TEL = StrTel;
                    tmpSendDocT.KEYWORDS = StrKey;

                    //tmpSendDocT.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    //tmpSendDocT.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    //tmpSendDocT.OWNERID = StrAddUserID;
                    //tmpSendDocT.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                    //tmpSendDocT.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                    tmpSendDocT.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                    tmpSendDocT.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                    //tmpSendDocT.UPDATEDATE = System.DateTime.Now;  取服务器端时间


                    tempStrSendDocName = StrTitle;

                    SendDocClient.SendDocInfoUpdateAsync(tmpSendDocT, StrUpdateReturn, "Edit");

                }
                //if (IsButtonSave)
                //{
                //    Save();
                //}
            }
            else
            {
                BackToSubmit();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("信息获取失败,请重试"), Utility.GetResourceStr("COMFIRM"), MessageIcon.Error);
                return;
            }
        }