コード例 #1
0
 private void SetUserControlObject(ObjectItem objItem, ref List <string> listObjectState)
 {
     for (int i = 0; i < objItem.Children.Count; i++)
     {
         ObjectItem child = objItem.Children[i] as ObjectItem;
         if (child == null)
         {
             continue;
         }
         if (child.ObjID == UserItem.ObjID)
         {
             if (child.IsChecked == false)
             {
                 CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N025", "You cannot cancel the management authority."));
                 IsCheckSelfPrimission = false;
             }
         }
         if (child.IsChecked == true)
         {
             listObjectState.Add(string.Format("{0}{1}{2}", child.ObjID, ConstValue.SPLITER_CHAR, "1"));
         }
         else if (child.IsChecked == false)
         {
             listObjectState.Add(string.Format("{0}{1}{2}", child.ObjID, ConstValue.SPLITER_CHAR, "0"));
         }
         SetUserControlObject(child, ref listObjectState);
     }
 }
コード例 #2
0
        private bool CheckInput()
        {
            string tempName = TxtRoleName.Text.Replace(" ", "");

            if (tempName == "")
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00034", "Role Information Is Not Complete"));
                return(false);
            }
            if (tempName.Count() > 128)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00041", "Role Name Is too long"));
                return(false);
            }
            if (string.IsNullOrEmpty(TxtRoleName.Text) || string.IsNullOrEmpty(DateStart.Value.ToString()) ||
                string.IsNullOrEmpty(DateEnd.Value.ToString()))
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00034", "Role Information Is Not Complete"));
                return(false);
            }

            DateTime starttiime = DateTime.Parse(DateStart.Value.ToString());
            DateTime stoptime   = DateTime.Parse(DateEnd.Value.ToString());

            if (starttiime >= stoptime)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00039", "Start Time Must Smaller Than The Valid Time"));
                return(false);
            }

            return(true);
        }
コード例 #3
0
 private void CaculateScore()
 {
     try
     {
         if (mCurrentScoreSheet != null)
         {
             var result = mCurrentScoreSheet.CheckInputValid();
             if (result.Code != 0)
             {
                 ShowException(string.Format("Check input valid fail.\t{0}", result.Code));
                 return;
             }
             var score  = mCurrentScoreSheet.CaculateScore();
             var viewer = BorderScoreSheetViewer.Child as StatisticalScoreSheetViewer;
             if (viewer != null)
             {
                 viewer.CaculateScore();
             }
             CurrentApp.ShowInfoMessage(string.Format("{0}\t{1}",
                                                      CurrentApp.GetMessageLanguageInfo("010", "Caculate score end."),
                                                      score.ToString("0.00")));
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
コード例 #4
0
ファイル: MainView.xaml.cs プロジェクト: chenmj201601/UMP
 private void DeleteDomianInfo()
 {
     try
     {
         if (Domaininfo == null)
         {
             return;
         }
         string strInfoMsg = CurrentApp.GetLanguageInfo("1112T008", "确定删除改域信息吗?");
         var    result     = MessageBox.Show(string.Format("{0}\r\n\r\n{1}",
                                                           CurrentApp.GetMessageLanguageInfo("003", "Confirm delete user ?"),
                                                           strInfoMsg), "UMP",
                                             MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             WebRequest webRequest = new WebRequest();
             webRequest.Code    = (int)S1112Codes.SaveDomainInfo;
             webRequest.Session = CurrentApp.Session;
             webRequest.ListData.Add("0");
             OperationReturn optR = XMLHelper.SeriallizeObject(Domaininfo);
             if (!optR.Result)
             {
                 CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optR.Code, optR.Message));
                 return;
             }
             webRequest.ListData.Add(optR.Data as string);
             Service11121Client client = new Service11121Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11121"));
             WebReturn webReturn = client.DoOperation(webRequest);
             client.Close();
             if (!webReturn.Result)
             {
                 //if (webReturn.Code == 99)
                 //{
                 //    App.ShowExceptionMessage(App.GetLanguageInfo("", "域名已存在"));
                 //}
                 //else
                 //{
                 CurrentApp.ShowExceptionMessage(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                 //}
                 return;
             }
             CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1112T002", "域信息删除成功"));
             //写操作日志
             string msg = string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("FO1112003", "delete"), Domaininfo.DomainName);
             CurrentApp.WriteOperationLog(string.Format("1112003"), ConstValue.OPT_RESULT_SUCCESS, msg);
             mListDomainInfo.Clear();
             InitDomainInfo();
         }
     }
     catch (Exception ex)
     {
         string msg = string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("FO1112003", "delete"), Domaininfo.DomainName);
         CurrentApp.WriteOperationLog(string.Format("1112003"), ConstValue.OPT_RESULT_FAIL, msg);
         CurrentApp.ShowExceptionMessage(ex.Message);
     }
 }
コード例 #5
0
        private void LevelEnableDisable(OperationType optType)
        {
            BookmarkLevelEntityInList level = lvBookmarkLevelsObject.SelectedItem as BookmarkLevelEntityInList;

            if (level == null)
            {
                return;
            }
            string strPopupMsg = string.Empty;

            if (optType == Common5100.OperationType.Enable)
            {
                if (level.BookmarkLevelStatus == "1")
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("5101007", "This is already enabled, without the need to repeat the"));
                    return;
                }
                else
                {
                    strPopupMsg = CurrentApp.GetLanguageInfo("5101010", "Are you sure to enable this?");
                }
            }
            else if (optType == Common5100.OperationType.Disable)
            {
                if (level.BookmarkLevelStatus == "0")
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("5101008", "This is a disabled state, no need to repeat the disabled"));
                    return;
                }
                else
                {
                    strPopupMsg = CurrentApp.GetLanguageInfo("5101009", "Are you sure to disable this?");
                }
            }
            string           strConfirm = CurrentApp.GetLanguageInfo("5102013", "Confirm");
            MessageBoxResult result     = MessageBox.Show(strPopupMsg, strConfirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                SetLevelStatus(optType, level);
            }
            else
            {
                string msg = string.Empty;
                if (optType == Common5100.OperationType.Enable)
                {
                    msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO5101003")), level.BookmarkLevelName);
                    CurrentApp.WriteOperationLog("5101003", ConstValue.OPT_RESULT_CANCEL, msg);
                }
                else if (optType == Common5100.OperationType.Disable)
                {
                    msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO5101004")), level.BookmarkLevelName);
                    CurrentApp.WriteOperationLog("5101004", ConstValue.OPT_RESULT_CANCEL, msg);
                }
            }
        }
コード例 #6
0
        private void ModifyRoleInfo(List <string> RoleList)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S1102Codes.ModifyRole;
                //px屏蔽
                //OperationReturn optReturn = XMLHelper.SeriallizeObject(RoleInfo);
                //if (!optReturn.Result)
                //{
                //    S1102App.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                //    return;
                //}
                //webRequest.Data = optReturn.Data.ToString();
                //px-end

                //px+
                webRequest.ListData = RoleList;
                //end

                //Service11021Client client = new Service11021Client();
                Wcf11021.Service11021Client client = new Service11021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11021"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.URPOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00033", "Role Name Already Exists"));
                        //引用对象的加密数据还原
                        //RoleInfo.RoleName = S1102App.DecryptString(RoleInfo.RoleName);
                        //RoleInfo.StrEnableTime = S1102App.DecryptString(RoleInfo.StrEnableTime);
                        //RoleInfo.StrEndTime = S1102App.DecryptString(RoleInfo.StrEndTime);
                        return;
                    }
                    else
                    {
                        CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                }
                RoleModel RoleInfo = this.ObjRoleItem as RoleModel;
                RoleInfo.RoleName      = S1102App.DecryptString(RoleList[1]);
                RoleInfo.StrEnableTime = Convert.ToDateTime(S1102App.DecryptString(RoleList[8])).ToLocalTime().ToString();
                RoleInfo.StrEndTime    = S1102App.DecryptString(RoleList[9]);
                mAsyncResult           = true;
            }
            catch (Exception ex)
            {
                CurrentApp.ShowExceptionMessage(ex.Message);
            }
        }
コード例 #7
0
        void AddNewRoleInfo(RoleModel newRoleInfo)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S1102Codes.AddNewRole;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(newRoleInfo);
                if (!optReturn.Result)
                {
                    #region
                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1102001"), RoleInfo.RoleName);
                    CurrentApp.WriteOperationLog(S1102Consts.OPT_AddRole.ToString(), ConstValue.OPT_RESULT_FAIL, msg);
                    #endregion
                    CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                webRequest.Data = optReturn.Data.ToString();

                //Service11021Client client = new Service11021Client();
                Wcf11021.Service11021Client client = new Service11021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11021"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.URPOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00033", "Role Name Already Exists"));
                        return;
                    }
                    else
                    {
                        CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                }
                else
                {
                    long RoleID = Convert.ToInt64(webReturn.Data);
                    AddRoleUser(RoleID);
                }
                mAsyncResult = true;
            }
            catch (Exception ex)
            {
                CurrentApp.ShowExceptionMessage(ex.Message);
            }
        }
コード例 #8
0
        private void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (AddRecordToLibrary() == false)
            {
                //CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("3102N050", "加入失败"));
                return;
            }
            CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("3102N049", "加入成功"));
            var parent = Parent as PopupPanel;

            if (parent != null)
            {
                parent.IsOpen = false;
            }
        }
コード例 #9
0
        private bool CheckAgentInfo()
        {
            if (AgentItem == null)
            {
                return(false);
            }
            var agentInfo = AgentItem.Data as AgentInfo;

            if (agentInfo == null)
            {
                return(false);
            }
            string strAgentNameID = agentInfo.AgentID;
            string agentID        = TxtAgentID.Text.Trim();

            if (agentID == string.Empty)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103022", "AgentID is empty"));
                return(false);
            }
            int AgentNum = 0;

            foreach (string a in strList)
            {
                if (a == agentInfo.AgentID)
                {
                    AgentNum++;
                }
            }

            if (strAgentNameID == agentID)
            {
                if (AgentNum > 1)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103034", "AgentID is not available"));
                    return(false);
                }
            }
            else
            {
                if (AgentNum > 0)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103034", "AgentID is not available"));
                    return(false);
                }
            }
            return(true);
        }
コード例 #10
0
        private void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            DateTime DTBeginStr = (DateTime)UC_DateTime_Begin.Value;
            DateTime DTEndStr   = (DateTime)UC_DateTime_End.Value;
            int      sec        = (DTEndStr - DTBeginStr).Seconds;

            if (sec < 0)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("6101N0010", "The time setting error"));
            }
            else
            {
                CollectData();
                SaveQueryCondition();
            }
        }
コード例 #11
0
ファイル: UC_KeyWorld.xaml.cs プロジェクト: chenmj201601/UMP
        private void DeleteKeyworld()
        {
            Service510011Client client = null;

            try
            {
                KeyWorldsEntityInList keyWorld   = lvKeyWorldsObject.SelectedItem as KeyWorldsEntityInList;
                WebRequest            webRequest = new WebRequest();
                webRequest.Code    = (int)S5100RequestCode.DeleteKeyWorld;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(keyWorld.KeyWorldID);
                client = new Service510011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                 WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service51001"));
                WebReturn webReturn = client.DoOperation(webRequest);
                CurrentApp.MonitorHelper.AddWebReturn(webReturn);
                client.Close();
                if (!webReturn.Result)
                {
                    if (webReturn.Code != Defines.RET_FAIL)
                    {
                        ShowException(CurrentApp.GetLanguageInfo(((int)webReturn.Code).ToString(), string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message)));
                        return;
                    }
                    else
                    {
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                }
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("OPR1", "Success"));
                UpdateListView(keyWorld, OperationType.Delete);
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
            finally
            {
                if (client != null)
                {
                    if (client.State == System.ServiceModel.CommunicationState.Opened)
                    {
                        client.Close();
                    }
                }
            }
        }
コード例 #12
0
        private bool CheckAgentInfo()
        {
            string agentID = this.TextBoxAgentID.Text.Trim();

            if (agentID == string.Empty)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103022", "AgentID is empty"));
                return(false);
            }
            int AgentNum = 0;

            foreach (DataRow dr in S1103App.IDataTable11101.Rows)
            {
                if (agentID == dr["C017"].ToString())
                {
                    AgentNum++;
                }
            }
            if (ModelID == "E")
            {
                if (strAgentNameID == agentID)
                {
                    if (AgentNum > 1)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103034", "AgentID is not available"));
                        return(false);
                    }
                }
                else
                {
                    if (AgentNum > 0)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103034", "AgentID is not available"));
                        return(false);
                    }
                }
            }
            else
            {
                if (AgentNum == 1)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103034", "AgentID is not available"));
                    return(false);
                }
            }
            return(true);
        }
コード例 #13
0
        void ButnNext_Click(object sender, RoutedEventArgs e)
        {
            if (!CheckInputNumber())
            {
                return;
            }
            //新建机器
            List <ObjectItem> tempObjItem = WizardHelper.ListAllObjectItem.Where(p => p.Type == 1).ToList();
            int ReadyMachineNumber        = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 210).ToList().Count();
            int j = 0;

            for (; j < tempObjItem.Count; j++)
            {
                ConfigGroup tempCG = tempObjItem[j].Data as ConfigGroup;
                if (tempCG.GroupID == 1 && tempCG.ChildType == 210)
                {
                    int MinValue = tempCG.GroupInfo.IntValue01; int MaxValue = tempCG.GroupInfo.IntValue02;
                    if ((ReadyMachineNumber + TotalMachineNumber) > MaxValue || (ReadyMachineNumber + TotalMachineNumber) < MinValue)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1110N008", "超过个数,不能增加"));
                        return;
                    }
                    for (int i = 0; i < TotalMachineNumber; i++)
                    {
                        //ListConfigObject.Add(WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 210));
                        ListConfigObject.Add(tempCG.ConfigObject);
                    }
                    break;
                }
            }
            //进入下一个配置界面
            UCWizardMachineConfig ucwizard = new UCWizardMachineConfig();

            ucwizard.CurrentApp            = CurrentApp;
            ucwizard.MainPage              = MainPage;
            ucwizard.PrePage               = this;
            ucwizard.TotalMachineNumber    = TotalMachineNumber;
            ucwizard.mListSaveConfigObject = ListConfigObject;
            ucwizard.WizardHelper          = this.WizardHelper;
            //ucwizard.ListConfigObjects = ListConfigObjects;
            MainPage.PopupPanel.Title   = "Config Wizard";
            MainPage.PopupPanel.Content = ucwizard;
            MainPage.PopupPanel.IsOpen  = true;
        }
コード例 #14
0
        private bool CheckInput()
        {
            if (string.IsNullOrEmpty(TxtAccount.Text.Trim()))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("008", "Account is empty"));
                return(false);
            }
            if (string.IsNullOrEmpty(TxtFullName.Text.Trim()))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("009", "FullName is empty"));
                return(false);
            }
            if (string.IsNullOrEmpty(TxtOrg.Text.Trim()))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("010", "ParentOrg is empty"));
                return(false);
            }
            try
            {
                DateTime starttiime = DateTime.Parse(dtValidTime.Value.ToString());
                try
                {
                    DateTime stoptime = DateTime.Parse(dtInValidTime.Value.ToString());
                    if (starttiime >= stoptime)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N023", "Start Time Must Smaller Than The Valid Time"));
                        return(false);
                    }
                }
                catch (Exception)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N021", "Convert Valid Time Error"));
                    return(false);
                }
            }
            catch (Exception)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N022", "Convert inValid Time Error"));
                return(false);
            }

            return(true);
        }
コード例 #15
0
 void BtnNewTabName_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(TxtNewTabName.Text))
     {
         //===================修改了提示框,并且为错误的提示信息设置了提示语言=============================
         CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("3102N019", string.Format("Tab name is empty")));
         return;
         //=================by 俞强波 ====================================================================
     }
     if (string.IsNullOrWhiteSpace(TxtNewTabName.Text))
     {
         CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("3102N019", string.Format("Tab name is empty")));
         return;
     }
     try
     {
         string strTabName = TxtNewTabName.Text;
         int    index      = 0;
         for (int i = 0; i < mListTabItems.Count; i++)
         {
             index = Math.Max(index, mListTabItems[i].TabIndex);
         }
         if (index < 10)
         {
             index = 10;
         }
         else
         {
             index++;
         }
         ConditionTabItem tabItem = new ConditionTabItem();
         tabItem.TabIndex = index;
         tabItem.TabName  = strTabName;
         mListTabItems.Add(tabItem);
         TabControlCondition.SelectedItem = tabItem;
         BorderNewTabName.Visibility      = Visibility.Collapsed;
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
コード例 #16
0
 private bool CheckInputNumber()
 {
     if (int.TryParse(this.TexNumMach.Text, out TotalMachineNumber))
     {
         if (TotalMachineNumber > 0 && TotalMachineNumber < 1024)
         {
             return(true);
         }
         else
         {
             CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1110WIZT0002", "请输入一个小于1024的正整数"));
             return(false);
         }
     }
     else
     {
         CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1110WIZT0001", "请输入一个正整数"));
         return(false);
     }
 }
コード例 #17
0
        public void CollectData()
        {
            DealCheckbox();
            InitCBTypeOfReport(); GetCheckedVoice();
            List <string> QueryData = new List <string>();

            QueryData.Add(Convert.ToDateTime(UC_DateTime_Begin.Value).ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"));
            QueryData.Add(Convert.ToDateTime(UC_DateTime_End.Value).ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"));
            string IP = "IP"; string CA = "CA"; string DB = "DB";

            if (mListSelectedObjects1.Count != 0)
            {
                for (int i = 0; i < mListSelectedObjects1.Count; i++)
                {
                    IP += mListSelectedObjects1[i].FullName + ";";
                }
                QueryData.Add(IP);
            }

            if (callin == 1 && callout != 0)
            {
                CA += 1; QueryData.Add(CA);
            }
            if (callin != 1 && callout == 0)
            {
                CA += 0; QueryData.Add(CA);
            }
            if (this.CBDepartBasic.SelectedIndex != -1)
            {
                DB += this.CBDepartBasic.SelectedIndex.ToString(); QueryData.Add(DB);
            }
            else
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("", "请选择部门依据"));
            }
            PageParent.ComfireClick(QueryData, SendDate);
        }
コード例 #18
0
ファイル: UCRecordMemo.xaml.cs プロジェクト: chenmj201601/UMP
        //这个只是将备注其存到T_31_046备注表
        private void SaveRecordMemo()
        {
            try
            {
                if (string.IsNullOrEmpty(TxtMemoContent.Text))
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N037", string.Format("Memo content is empty")));
                    return;
                }
                if (TxtMemoContent.Text.ToString().Length > 1024)
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N036", "Save the content is too long"));
                    return;
                }
                RecordMemoItem item = mListRecordMemos.FirstOrDefault(m => m.UserID == CurrentApp.Session.UserID);
                if (item == null)
                {
                    RecordMemoInfo info = new RecordMemoInfo();
                    info.ID               = 0;
                    info.RecordSerialID   = RecordInfoItem.SerialID;
                    info.UserID           = CurrentApp.Session.UserID;
                    info.MemoTime         = DateTime.Now;
                    info.Content          = TxtMemoContent.Text;
                    info.State            = "1";
                    info.LastModifyUserID = CurrentApp.Session.UserID;
                    info.LastModifyTime   = DateTime.Now;
                    info.Source           = "U";
                    item = new RecordMemoItem(info);
                }
                else
                {
                    RecordMemoInfo info = item.RecordMemoInfo;
                    info.Content          = TxtMemoContent.Text;
                    info.LastModifyUserID = CurrentApp.Session.UserID;
                    info.LastModifyTime   = DateTime.Now;
                }
                OperationReturn optReturn = XMLHelper.SeriallizeObject(item.RecordMemoInfo);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                string strMemoInfo = optReturn.Data.ToString();

                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.SaveRecordMemoInfo;
                webRequest.ListData.Add(RecordInfoItem.SerialID.ToString());
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(strMemoInfo);
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31021"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                CurrentApp.WriteLog(string.Format("Save RecordMemo end.\t{0}", webReturn.Data));

                #region 写操作日志

                string strLog = string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102001RecordReference"), item.RecordSerialID);
                strLog += string.Format("{0}", item.Content);
                CurrentApp.WriteOperationLog(S3102Consts.OPT_MEMORECORD.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                #endregion

                CurrentApp.ShowInfoMessage(CurrentApp.GetMessageLanguageInfo("003", "Save RecordMemo end"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
コード例 #19
0
        private void AddRoleInfo()
        {
            try
            {
                RoleInfo = new RoleModel();

                RoleInfo.ParentRoleID = 0;
                RoleInfo.ModeID       = 0;
                string msg = string.Format("{0}{1}", Utils.FormatOptLogString("FO1102001"), TxtRoleName.Text);
                if (string.IsNullOrWhiteSpace(TxtRoleName.Text))
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00034", "Role Information Is Null"));
                    return;
                }
                RoleInfo.RoleName    = S1102App.EncryptString(TxtRoleName.Text.Trim());
                RoleInfo.IsActive    = ChkStartRole.IsChecked == true ? "1" : "0";
                RoleInfo.IsDelete    = "0";
                RoleInfo.OtherStatus = "11111111111111111111111111111111";

                RoleInfo.EnableTime = DateTime.Parse(DateStart.Value.ToString());
                RoleInfo.EndTime    = DateTime.Parse(DateEnd.Value.ToString());

                RoleInfo.StrEnableTime = S1102App.EncryptString(RoleInfo.EnableTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss"));
                RoleInfo.StrEndTime    = S1102App.EncryptString(RoleInfo.EndTime.ToString("yyyy/MM/dd HH:mm:ss"));
                RoleInfo.CreatorID     = CurrentApp.Session.UserInfo.UserID;
                RoleInfo.CreatTime     = DateTime.Parse(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")).ToUniversalTime();
                mAsyncResult           = false;
                if (PageParent != null)
                {
                    PageParent.SetBusy(true, string.Empty);
                }
                mBackgroundWorker         = new BackgroundWorker();
                mBackgroundWorker.DoWork += (s, de) =>
                {
                    ShowStausMessage(CurrentApp.GetLanguageInfo("1102T00035", "Adding Role Information") + "....");
                    AddNewRoleInfo(RoleInfo);
                    #region 写操作日志

                    CurrentApp.WriteOperationLog(S1102Consts.OPT_AddRole.ToString(), ConstValue.OPT_RESULT_SUCCESS, msg);
                    #endregion
                };
                mBackgroundWorker.RunWorkerCompleted += (s, re) =>
                {
                    mBackgroundWorker.Dispose();
                    if (PageParent != null)
                    {
                        PageParent.SetBusy(false, string.Empty);
                    }

                    ShowStausMessage(CurrentApp.GetLanguageInfo("1102T00036", "Add Role Information End") + ".");
                    if (mAsyncResult)
                    {
                        if (PageParent != null)
                        {
                            PageParent.ReloadData();
                            PageParent.ShowObjectDetail();
                        }
                        var parent = Parent as PopupPanel;
                        if (parent != null)
                        {
                            parent.IsOpen = false;
                        }
                    }
                };
                mBackgroundWorker.RunWorkerAsync();
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #20
0
        private void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <DomainObjectItem> mListSaveDomainInfo = new List <DomainObjectItem>();

            //获取所有打钩的对象
            GetSaveObject(mRoot, ref mListSaveDomainInfo);
            if (mListSaveDomainInfo.Count == 0)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("", "请选择用户")); return;
            }
            try
            {
                foreach (DomainObjectItem BItem in mListSaveDomainInfo)
                {
                    BasicUserInfo basicUserInfo = new BasicUserInfo();
                    basicUserInfo.SourceFlag = "L";

                    basicUserInfo.CreateTime    = DateTime.Now;
                    basicUserInfo.StartTime     = DateTime.Parse("2014/1/1 00:00:00");
                    basicUserInfo.EndTime       = DateTime.Parse(S1101Consts.Default_StrEndTime.ToString());
                    basicUserInfo.StrCreateTime = basicUserInfo.CreateTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                    basicUserInfo.StrStartTime  = basicUserInfo.StartTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                    basicUserInfo.StrEndTime    = basicUserInfo.EndTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                    if (BItem.FullName.Contains("@"))
                    {
                        basicUserInfo.Account = BItem.FullName;
                    }
                    else
                    {
                        basicUserInfo.Account = string.Format("{0}@{1}", IStrADDomain, BItem.FullName);
                    }
                    basicUserInfo.Creator   = CurrentApp.Session.UserID;
                    basicUserInfo.FullName  = BItem.Name;
                    basicUserInfo.OrgID     = OrgObjItem.ObjID;
                    basicUserInfo.Password  = string.Empty;
                    basicUserInfo.IsActived = "1";


                    OperationReturn optReturn = XMLHelper.SeriallizeObject(basicUserInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)S1101Codes.LoadNewUser;
                    webRequest.Data    = optReturn.Data.ToString();
                    Service11011Client client = new Service11011Client(
                        WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                        WebHelper.CreateEndpointAddress(
                            CurrentApp.Session.AppServerInfo,
                            "Service11011"));
                    WebHelper.SetServiceClient(client);
                    WebReturn webReturn = client.DoOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
                        {
                            ShowException(CurrentApp.GetMessageLanguageInfo("007", "User account already exist"));
                            //return;
                            continue;
                        }
                        ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                    basicUserInfo.UserID = Convert.ToInt64(webReturn.Data);
                    //修改密码为M003加码
                    webRequest.Code = (int)S1101Codes.ModifyUserPasswordM003;
                    webRequest.ListData.Add(basicUserInfo.UserID.ToString());
                    webRequest.ListData.Add("0");
                    webRequest.ListData.Add(string.Empty);
                    Service11011Client clientCP = new Service11011Client(
                        WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                        WebHelper.CreateEndpointAddress(
                            CurrentApp.Session.AppServerInfo,
                            "Service11011"));
                    WebHelper.SetServiceClient(clientCP);
                    WebReturn webReturnCP = clientCP.DoOperation(webRequest);
                    clientCP.Close();
                    if (!webReturnCP.Result)
                    {
                        ShowException(string.Format("Change Passworld Fail:{0}\t{1}", webReturnCP.Code, webReturnCP.Message));
                    }
                }
                ParenntPage.ReloadData();
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N029", "Import User Data Successful"));

                string msg = string.Format("{0}:{1}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1101012"), IStrADDomain);
                CurrentApp.WriteOperationLog(S1101Consts.OPT_LDAP.ToString(), ConstValue.OPT_RESULT_SUCCESS, msg);
            }
            catch (Exception ex)
            {
                ShowException(CurrentApp.GetLanguageInfo("1101N037", "导入失败") + ex.Message);
                #region 日志
                string msg = string.Format("{0}:{1}", Utils.FormatOptLogString("FO1101012"), IStrADDomain);
                CurrentApp.WriteOperationLog("1101012", ConstValue.OPT_RESULT_FAIL, msg);
                #endregion
            }
            PageClose();
        }
コード例 #21
0
        private void ModifyAgent()
        {
            try
            {
                if (AgentItem == null)
                {
                    return;
                }
                var agentInfo = AgentItem.Data as AgentInfo;
                if (agentInfo == null)
                {
                    return;
                }
                if (string.IsNullOrEmpty(TxtAgentID.Text))
                {
                    ShowException(string.Format("AgentID empty!"));
                    return;
                }
                if (TxtAgentID.Text.Length > 128)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103040", "Add content should not exceed 120 characters."));
                    return;
                }
                else
                {
                    agentInfo.AgentID = TxtAgentID.Text;
                }
                if (TxtAgentName.Text.Length > 128)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103040", "Add content should not exceed 120 characters."));
                    return;
                }
                else
                {
                    agentInfo.AgentName = TxtAgentName.Text;
                }
                agentInfo.State  = RadioStateEnable.IsChecked == true ? 1 : 2;
                agentInfo.Tenure = ComboBoxTenure.SelectedIndex;
                OperationReturn optReturn;
                optReturn = XMLHelper.SeriallizeObject(agentInfo);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                string strInfo = optReturn.Data.ToString();

                int              errCode = 0;
                string           strMsg  = string.Empty;
                BackgroundWorker worker  = new BackgroundWorker();
                worker.DoWork += (s, de) =>
                {
                    try
                    {
                        WebRequest webRequest = new WebRequest();
                        webRequest.Session = CurrentApp.Session;
                        webRequest.Code    = (int)S1103Codes.ModifyAgent;
                        webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
                        webRequest.ListData.Add("3");
                        webRequest.ListData.Add(strInfo);
                        //Service11031Client client = new Service11031Client();
                        Service11031Client client =
                            new Service11031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11031"));
                        WebReturn webReturn = client.DoOperation(webRequest);
                        client.Close();
                        if (!webReturn.Result)
                        {
                            errCode = webReturn.Code;
                            strMsg  = webReturn.Message;
                            return;
                        }
                        if (webReturn.ListData == null ||
                            webReturn.ListData.Count < 1)
                        {
                            errCode = Defines.RET_PARAM_INVALID;
                            strMsg  = string.Format("WS return fail.");
                            return;
                        }
                        string strSerialID = webReturn.ListData[0];
                        CurrentApp.WriteLog("ModifyAgent", string.Format("End.\t{0}", strSerialID));
                    }
                    catch (Exception ex)
                    {
                        errCode = Defines.RET_FAIL;
                        strMsg  = ex.Message;
                    }
                };
                worker.RunWorkerCompleted += (s, re) =>
                {
                    worker.Dispose();

                    if (errCode > 0)
                    {
                        ShowException(string.Format("{0}\t{1}", errCode, strMsg));
                        return;
                    }
                    ShowInformation(string.Format("Modify agnet successful!"));

                    if (PageParent != null)
                    {
                        PageParent.ReloadData();
                    }
                    var panel = Parent as PopupPanel;
                    if (panel != null)
                    {
                        panel.IsOpen = false;
                    }
                };
                worker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
コード例 #22
0
        private void SaveScoreInfo()
        {
            try
            {
                DateTime scoreStopTime = DateTime.Now;
                double   aaa           = (scoreStopTime - mScoreStartTime).TotalSeconds;
                //MessageBox.Show(aaa.ToString());
                ScoreSheetItem.ScoreSheetInfo.WasteTime = aaa;
                //MessageBox.Show("sss");
                if (mCurrentScoreSheet == null)
                {
                    return;
                }
                mCurrentScoreSheet.CaculateScore();
                ScoreSheetItem.ScoreSheetInfo.Score = mCurrentScoreSheet.Score;
                ScoreSheetItem.Score = ScoreSheetItem.ScoreSheetInfo.Score;
                if (!SaveScoreSheetResult())
                {
                    return;
                }
                SaveScoreDataResult();
                List <ScoreItem> listItems = new List <ScoreItem>();
                mCurrentScoreSheet.GetAllScoreItem(ref listItems);
                mListScoreItemResults.Clear();
                for (int i = 0; i < listItems.Count; i++)
                {
                    var temp = mListScoreItemResults.FirstOrDefault(s => s.ScoreResultID == ScoreSheetItem.ScoreResultID
                                                                    &&
                                                                    s.ScoreSheetID == ScoreSheetItem.ScoreSheetID &&
                                                                    s.ScoreItemID == listItems[i].ID);
                    if (temp == null)
                    {
                        temp = new BasicScoreItemInfo();
                        temp.ScoreResultID = ScoreSheetItem.ScoreResultID;
                        temp.ScoreSheetID  = ScoreSheetItem.ScoreSheetID;
                        temp.ScoreItemID   = listItems[i].ID;
                        temp.IsNA          = listItems[i].IsNA ? "Y" : "N";
                        mListScoreItemResults.Add(temp);
                    }
                    temp.Score     = listItems[i].Score;
                    temp.RealScore = listItems[i].RealScore;
                }
                if (!SaveScoreItemResult())
                {
                    return;
                }
                if (!SaveScoreCommentResult())
                {
                    return;
                }

                #region 写操作日志

                string strLog = string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102001RecordReference"), ScoreSheetItem.RecordSerialID);
                strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102003Title"), ScoreSheetItem.Title);
                strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102003Score"), ScoreSheetItem.Score);
                CurrentApp.WriteOperationLog(S3102Consts.OPT_SCORERECORD.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                #endregion
                if (RecordInfoItem != null)
                {
                    RecordInfoItem.IsScored    = 1;
                    RecordInfoItem.StrIsScored = CurrentApp.GetLanguageInfo(string.Format("3102TIP001IsScored{0}", RecordInfoItem.IsScored), RecordInfoItem.IsScored.ToString());
                }

                CurrentApp.ShowInfoMessage(CurrentApp.GetMessageLanguageInfo("005", "Save Score info end"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
コード例 #23
0
        private void ModifyAgentPassword()
        {
            GlobalParamInfo GlobalParam = new GlobalParamInfo();

            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)RequestCode.WSGetGlobalParamList;
                webRequest.ListData.Add("11");
                webRequest.ListData.Add("11010501");
                webRequest.ListData.Add(string.Empty);

                Service11012Client client = new Service11012Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11012"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }

                OperationReturn optReturn = XMLHelper.DeserializeObject <GlobalParamInfo>(webReturn.ListData[0]);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("InitColumnData Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                GlobalParam = optReturn.Data as GlobalParamInfo;
                if (GlobalParam == null)
                {
                    return;
                }
            }
            catch (Exception ex) { ShowException(ex.Message); }
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S1103Codes.UPAgentPwd;
                webRequest.ListData.Add(mCurrentItem.ObjID.ToString());
                //  webRequest.ListData.Add(mCurrentItem.Name.ToString());
                webRequest.ListData.Add(GlobalParam.ParamValue.Substring(8));//新密码
                //  Service11031Client client = new Service11031Client();
                Service11031Client client = new Service11031Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11031"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (webReturn.Result)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103030", "Modify Sucessed"));
                    #region 写操作日志
                    string msg_success = string.Format("{0} {1} :{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1103004"), mCurrentItem.Name);
                    CurrentApp.WriteOperationLog("1103004", ConstValue.OPT_RESULT_SUCCESS, msg_success);
                    #endregion
                }
                else//失败
                {
                    ShowException(string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("S1103031", webReturn.Message), webReturn.Message));
                    #region 写操作日志
                    string msg_Fail = string.Format("{0} {1} :{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1103004"), mCurrentItem.Name);
                    CurrentApp.WriteOperationLog("1103004".ToString(), ConstValue.OPT_RESULT_FAIL, msg_Fail);
                    #endregion
                }
            }
            catch (Exception ex) { ShowException(ex.Message); }
        }
コード例 #24
0
        private void SaveQueryCondition()
        {
            if (this.CbSaveConditions.IsChecked == true)
            {
                //循环找出是否有重名的,有的话覆盖资料
                string conditionName = this.ComboQueryConditions.Text;
                if (conditionName.Trim() == string.Empty)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("6101N0006", "Name cannot be Empty.")); return;
                }
                long           queryCode     = 0;
                List <string>  ListSaveDatas = new List <string>();
                QueryCondition SaveCondition = new QueryCondition();
                bool           Flag          = false;
                for (int i = 0; i < mListQueryConditions.Count; i++)
                {
                    if (mListQueryConditions[i].Name == conditionName)
                    {
                        SaveCondition.IsUse        = mListQueryConditions[i].IsUse;
                        SaveCondition.mName        = mListQueryConditions[i].Name;
                        SaveCondition.mDescription = mListQueryConditions[i].Description;
                        SaveCondition.Priority     = mListQueryConditions[i].Priority;
                        SaveCondition.QueryCode    = mListQueryConditions[i].QueryCode;
                        SaveCondition.UserID       = mListQueryConditions[i].UserID;
                        SaveCondition.ReportCode   = mListQueryConditions[i].ReportCode;
                        SaveCondition.SetTime      = mListQueryConditions[i].SetTime;
                        SaveCondition.LastUseTime  = mListQueryConditions[i].LastUseTime;
                        SaveCondition.Source       = mListQueryConditions[i].Source;
                        Flag = true;
                        break;
                    }
                }
                if (!Flag)//没找到,要新建
                {
                    SaveCondition.QueryCode    = 0;
                    SaveCondition.UserID       = CurrentApp.Session.UserID;
                    SaveCondition.ReportCode   = 61010021;
                    SaveCondition.SetTime      = DateTime.Now;
                    SaveCondition.Source       = 'S';
                    SaveCondition.LastUseTime  = DateTime.Now;
                    SaveCondition.mName        = this.ComboQueryConditions.Text;
                    SaveCondition.mDescription = this.ComboQueryConditions.Text;
                    SaveCondition.Priority     = mListQueryConditions.Count;
                    SaveCondition.IsUse        = true;
                }
                OperationReturn optReturn = XMLHelper.SeriallizeObject <QueryCondition>(SaveCondition);
                if (!optReturn.Result)
                {
                    ShowException(CurrentApp.GetLanguageInfo("", "Save Fail!")); return;
                }
                ListSaveDatas.Add(optReturn.Data as string);
                queryCode = SaveCondition.QueryCode;
                //添加detail。
                for (int i = 1; i <= 3; i++)
                {
                    QueryConditionItem queryItem = new QueryConditionItem();
                    queryItem.QueryConditionCode = queryCode;
                    queryItem.Sort = i;
                    queryItem.Type = 0;
                    switch (i)
                    {
                    case 1:    //录音时间
                        queryItem.QueryItemCode = (long)Const6101.Query_RecordTime;

                        queryItem.Value1 = this.UC_DateTime_Begin.Text;
                        queryItem.Value2 = this.UC_DateTime_End.Text;
                        queryItem.Value3 = this.CBXLoggedTime.SelectedIndex.ToString();
                        break;

                    case 2:    //呼叫方向
                        queryItem.QueryItemCode = (long)Const6101.Query_Call;
                        if (this.RButn2.IsChecked == true)
                        {
                            queryItem.Value1 = "1";
                        }
                        else if (this.RButn3.IsChecked == true)
                        {
                            queryItem.Value1 = "0";
                        }
                        else
                        {
                            queryItem.Value1 = "2";
                        }
                        break;

                    case 3:    //报表类型
                        queryItem.QueryItemCode = (long)Const6101.Query_ReportType;
                        queryItem.Value1        = this.CBTypeOfReport.SelectedIndex.ToString();
                        break;
                    }
                    OperationReturn optReturnItem = XMLHelper.SeriallizeObject <QueryConditionItem>(queryItem);
                    if (!optReturnItem.Result)
                    {
                        ShowException(CurrentApp.GetLanguageInfo("", "Save Fail!")); return;
                    }
                    ListSaveDatas.Add(optReturnItem.Data as string);
                }
                //调用函数方法保存
                WebRequest webRequest = new WebRequest();
                webRequest.Code     = (int)WebCodes.SaveQueryCondition;
                webRequest.ListData = ListSaveDatas;
                webRequest.Session  = CurrentApp.Session;
                Service61012Client client = new Service61012Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service61012"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.UMPReportOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                S6101App.InitObjects();
                InitQueryCondition();
            }
        }
コード例 #25
0
ファイル: UCSkillGroup.xaml.cs プロジェクト: chenmj201601/UMP
        public List <string> GetDateSkillGroup()
        {
            List <string> LListStrWcfArgs = new List <string>();
            string        LStrSkillCode = string.Empty, LStrSkillName = string.Empty;
            string        LStrTypeDescriber = string.Empty;

            try
            {
                LStrSkillCode = TexSkillGroupCode.Text.Trim();
                if (string.IsNullOrEmpty(LStrSkillCode))
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1104T007", ""));
                    return(LListStrWcfArgs);
                }
                if (LStrSkillCode.Length > 128)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1104T005", ""));
                    return(LListStrWcfArgs);
                }
                LStrSkillName = TexSkillGroupName.Text.Trim();
                if (string.IsNullOrEmpty(LStrSkillName))
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1104T008", ""));
                    return(LListStrWcfArgs);
                }
                if (LStrSkillName.Length > 128)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1104T006", ""));
                    return(LListStrWcfArgs);
                }

                LStrTypeDescriber = TexSkillGroupDescription.Text.Trim();
                if (LStrTypeDescriber.Length > 1024)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1104T003", ""));
                    return(LListStrWcfArgs);
                }

                LListStrWcfArgs.Add(CurrentApp.Session.DatabaseInfo.TypeID.ToString());                                  //0
                LListStrWcfArgs.Add(CurrentApp.Session.DatabaseInfo.GetConnectionString());                              //1
                LListStrWcfArgs.Add(CurrentApp.Session.RentInfo.Token);                                                  //2
                LListStrWcfArgs.Add("2");                                                                                //3
                if (IStrCurrentMethod == "E" || IStrCurrentMethod == "D")                                                //4
                {
                    LListStrWcfArgs.Add(SGTreeVItem.ObjID.ToString());
                }
                else
                {
                    LListStrWcfArgs.Add("0");
                }
                if (this.CheckboxSkillGroupStatu.IsChecked == true)                                                                    //5
                {
                    LListStrWcfArgs.Add("1");
                }
                else
                {
                    LListStrWcfArgs.Add("0");
                }
                LListStrWcfArgs.Add(LStrSkillCode);                                                    //6
                LListStrWcfArgs.Add(CurrentApp.Session.UserID.ToString());                             //7
                LListStrWcfArgs.Add(LStrTypeDescriber);                                                //8
                LListStrWcfArgs.Add(LStrSkillName);                                                    //9
                if (IStrCurrentMethod == "E" || IStrCurrentMethod == "D")                              //10
                {
                    LListStrWcfArgs.Add(SGTreeVItem.LockMethod.ToString());
                }
                else
                {
                    if (S1104App.IDataTable11009.Rows == null || S1104App.IDataTable11009.Rows.Count == 0)
                    {
                        LListStrWcfArgs.Add("1");
                    }
                    else
                    {
                        LListStrWcfArgs.Add((S1104App.IDataTable11009.Select("C000 = 2", "C002 ASC").Length + 1).ToString());
                    }
                }
                LListStrWcfArgs.Add("");                                                                                    //11
                LListStrWcfArgs.Add(IStrCurrentMethod);
                return(LListStrWcfArgs);
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                return(LListStrWcfArgs);
            }
        }
コード例 #26
0
        private void ModifyKeyWorld()
        {
            Service510011Client client = null;

            try
            {
                KeyWorldsEntityInList keyworld = new KeyWorldsEntityInList();
                BookmarkLevelEntity   level    = (cmbLevels.SelectedItem as ComboBoxItem).DataContext as BookmarkLevelEntity;
                keyworld.KeyWorldID         = keyWorldInModify.KeyWorldID;
                keyworld.KeyWorldContent    = txtName.Text;
                keyworld.BookmarkLevelID    = level.BookmarkLevelID;
                keyworld.BookmarkLevelColor = level.BookmarkLevelColor;
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S5100RequestCode.ModifyKeyWorld;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(keyworld.KeyWorldID);
                webRequest.ListData.Add(level.BookmarkLevelID);
                client = new Service510011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                 WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service51001"));
                WebReturn webReturn = client.DoOperation(webRequest);
                CurrentApp.MonitorHelper.AddWebReturn(webReturn);
                client.Close();
                string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO5102002")), txtName.Text);
                msg += Utils.FormatOptLogString(string.Format("5102012")) + keyWorldInModify.LevelName + " -- " + level.BookmarkLevelName;
                if (!webReturn.Result)
                {
                    CurrentApp.WriteOperationLog("5102002", ConstValue.OPT_RESULT_FAIL, msg);
                    if (webReturn.Code != Defines.RET_FAIL)
                    {
                        if (webReturn.Code == (int)S5100WcfErrorCode.UploadKeyWorldXmlFailed)
                        {
                            string strMsg = CurrentApp.GetLanguageInfo(((int)webReturn.Code).ToString(), "Upload file failed, may be right enough, please complete control of license to the '{0}' folder Everyone");
                            strMsg = string.Format(strMsg, webReturn.Message);
                            ShowException(strMsg);
                        }
                        else
                        {
                            ShowException(CurrentApp.GetLanguageInfo(((int)webReturn.Code).ToString(), string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message)));
                        }
                    }
                    else
                    {
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                    if (webReturn.Code > (int)S5100WcfErrorCode.GenerateKeyWorldXmlException)
                    {
                        ParentPage.UpdateListView(keyworld, OperationType.Modify);
                    }
                }
                else
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("OPR1", "Success"));
                    CurrentApp.WriteOperationLog("5102002", ConstValue.OPT_RESULT_SUCCESS, msg);
                    ParentPage.UpdateListView(keyworld, OperationType.Modify);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
            finally
            {
                if (client != null)
                {
                    if (client.State == System.ServiceModel.CommunicationState.Opened)
                    {
                        client.Close();
                    }
                }
            }
        }
コード例 #27
0
        private void AddNewUser()
        {
            try
            {
                string        strLog        = string.Empty;
                BasicUserInfo basicUserInfo = new BasicUserInfo();

                if (TxtAccount.Text.Length > 64 || TxtFullName.Text.Length > 64)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N024", "User Name is invalid."));
                    return;
                }
                if (TxtAccount.Text.Replace(" ", "") == string.Empty || TxtFullName.Text.Replace(" ", "") == string.Empty)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N026", "User Name is invalid."));
                    return;
                }
                if (TxtAccount.Text.Contains("@") || TxtFullName.Text.Contains("@"))
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N041", "User Name is Contain @."));
                    return;
                }
                if (TxtAccount.Text.Contains(@"\") || TxtFullName.Text.Contains(@"\"))
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N042", @"User Name is Contain \."));
                    return;
                }
                basicUserInfo.Account = TxtAccount.Text.Trim();
                strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10201"), TxtAccount.Text);
                basicUserInfo.FullName = TxtFullName.Text.Trim();
                strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10202"), TxtFullName.Text.Trim());
                if (OrgInfo != null)
                {
                    basicUserInfo.OrgID = OrgInfo.OrgID;
                }
                string strIsActive = string.Empty;
                strIsActive             = chkIsActive.IsChecked == true ? "1" : "0";
                basicUserInfo.IsActived = strIsActive;
                if (strIsActive == "1")
                {
                    strLog += string.Format("{0}", Utils.FormatOptLogString("1101T10109"));
                }

                basicUserInfo.SourceFlag = "U";

                basicUserInfo.StartTime    = DateTime.Parse(dtValidTime.Value.ToString());
                basicUserInfo.EndTime      = DateTime.Parse(dtInValidTime.Value.ToString());
                basicUserInfo.StrStartTime = basicUserInfo.StartTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                basicUserInfo.StrEndTime   = basicUserInfo.EndTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");

                ExtendUserInfo extUserInfo = new ExtendUserInfo();
                if (mIsExtInfoChanged)
                {
                    extUserInfo.MailAddress = TxtEmail.Text.Trim();
                    strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10203"), TxtEmail.Text);
                    extUserInfo.PhoneNumber = TxtPhone.Text.Trim();
                    strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10204"), TxtPhone.Text);
                    extUserInfo.Birthday = TxtBirthday.Value.ToString();
                    strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10205"), TxtBirthday.Value);
                    var headIcon = ComboHeadIcon.SelectedItem as HeadIconInfo;
                    if (headIcon != null)
                    {
                        extUserInfo.HeadIcon = headIcon.Icon;
                        strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10214"), headIcon.Icon);
                    }
                }
                mAsyncResult = false;
                if (PageParent != null)
                {
                    PageParent.SetBusy(true, string.Empty);
                }
                mBackgroundWorker         = new BackgroundWorker();
                mBackgroundWorker.DoWork += (s, de) =>
                {
                    AddNewUser(basicUserInfo);
                    if (mAsyncResult &&
                        mIsExtInfoChanged &&
                        !string.IsNullOrEmpty(basicUserInfo.UserID.ToString()))
                    {
                        extUserInfo.UserID = basicUserInfo.UserID;
                        mAsyncResult       = false;
                        ModifyExtUserInfo(extUserInfo);
                    }
                };
                mBackgroundWorker.RunWorkerCompleted += (s, re) =>
                {
                    mBackgroundWorker.Dispose();
                    if (PageParent != null)
                    {
                        PageParent.SetBusy(false, string.Empty);
                    }
                    if (mAsyncResult)
                    {
                        #region 写操作日志

                        CurrentApp.WriteOperationLog(S1101Consts.OPT_ADDUSER.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                        #endregion

                        if (PageParent != null)
                        {
                            PageParent.ReloadData(ObjParent);
                        }
                        var parent = Parent as PopupPanel;
                        if (parent != null)
                        {
                            parent.IsOpen = false;
                        }
                    }
                };
                mBackgroundWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
コード例 #28
0
        private void ModifyUserInfo()
        {
            try
            {
                if (BasicUserInfo == null)
                {
                    return;
                }
                string account, fullName, strReset;
                string strLog      = string.Empty;
                string strIsActive = string.Empty;
                string strLock     = string.Empty;
                string UserName    = TxtAccount.Text.Trim();
                if (UserName.Contains("@"))
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N041", "User Name is invalid."));
                    return;
                }
                if (TxtAccount.Text.Length > 64 || TxtFullName.Text.Length > 64)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N024", "User Name is invalid."));
                    return;
                }
                if (TxtAccount.Text.Replace(" ", "") == string.Empty || TxtFullName.Text.Replace(" ", "") == string.Empty)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N026", "User Name is invalid."));
                    return;
                }
                account  = TxtAccount.Text.Trim();
                strLog  += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10201"), account);
                fullName = TxtFullName.Text.Trim();
                strLog  += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10202"), fullName);
                //if (BasicUserInfo.LockMethod == "N" && CbLock.IsChecked == true)
                //{
                //    strLock = "U";
                //}
                //else if (BasicUserInfo.LockMethod == "U" && CbLock.IsChecked == false)
                //{
                //    strLock = "C";
                //}
                //else
                //{
                //    strLock = string.Empty;
                //}

                //1为锁,0为未锁
                if (BasicUserInfo.IsLocked == "1")
                {
                    if (CbLock.IsChecked == false)
                    {
                        if (BasicUserInfo.LockMethod == "L")
                        {
                            strLock = "CL";
                        }
                        else
                        {
                            strLock = "CU";
                        }
                    }
                    else
                    {
                        strLock = String.Empty;
                    }
                }
                else if (BasicUserInfo.IsLocked == "0")
                {
                    if (CbLock.IsChecked == true)
                    {
                        strLock = "U";
                    }
                    else
                    {
                        strLock = String.Empty;
                    }
                }
                else
                {
                    strLock = string.Empty;
                }


                if (CbLock.IsChecked == true)
                //if (!string.IsNullOrEmpty(strLock))
                {
                    strLog += string.Format("{0} ", Utils.FormatOptLogString("11011100"));
                }
                strReset = CbResetPwd.IsChecked == true ? "1" : "0";
                if (strReset == "1")
                {
                    strLog += string.Format("{0} ", Utils.FormatOptLogString("11011101"));
                }

                DateTime validTime = DateTime.Parse(dtValidTime.Value.ToString()).ToUniversalTime();
                strLog += string.Format("{0} {1}", Utils.FormatOptLogString("1101T10105"), validTime);
                DateTime inValidTime = DateTime.Parse(dtInValidTime.Value.ToString()).ToUniversalTime();
                strLog += string.Format("{0} {1}", Utils.FormatOptLogString("1101T10106"), inValidTime);


                //0     UserID
                //1     Account
                //2     FullName
                //3     Locked
                //4     ResetPassword
                //5     IsActive
                //6     ValidTime
                //7     InValidTime
                List <string> listParams = new List <string>();
                listParams.Add(BasicUserInfo.UserID.ToString());
                listParams.Add(account);
                listParams.Add(fullName);
                listParams.Add(strLock);
                listParams.Add(strReset);
                strIsActive = chkIsActive.IsChecked == true ? "1" : "0";
                listParams.Add(strIsActive);
                listParams.Add(validTime.ToString("yyy/MM/dd HH:mm:ss"));
                listParams.Add(inValidTime.ToString("yyy/MM/dd HH:mm:ss"));
                if (strIsActive == "1")
                {
                    strLog += string.Format("{0}", Utils.FormatOptLogString("1101T10109"));
                }

                ExtendUserInfo extUserInfo = new ExtendUserInfo();
                if (mIsExtInfoChanged)
                {
                    extUserInfo.UserID      = BasicUserInfo.UserID;
                    extUserInfo.MailAddress = TxtEmail.Text;
                    strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10203"), TxtEmail.Text);
                    extUserInfo.PhoneNumber = TxtPhone.Text;
                    strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10204"), TxtPhone.Text);
                    extUserInfo.Birthday = TxtBirthday.Value.ToString();
                    strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("1101T10205"), TxtBirthday.Value);
                    var headIcon = ComboHeadIcon.SelectedItem as HeadIconInfo;
                    if (headIcon != null)
                    {
                        extUserInfo.HeadIcon = headIcon.Icon;
                        strLog += string.Format("{0} {1}  ", Utils.FormatOptLogString("1101T10214"), headIcon.Icon);
                    }
                }
                mAsyncResult = false;
                if (PageParent != null)
                {
                    PageParent.SetBusy(true, string.Empty);
                }
                mBackgroundWorker         = new BackgroundWorker();
                mBackgroundWorker.DoWork += (s, de) =>
                {
                    ModifyUserInfo(listParams);
                    if (mAsyncResult && mIsExtInfoChanged)
                    {
                        mAsyncResult = false;
                        ModifyExtUserInfo(extUserInfo);
                        //px+
                        if (extUserInfo.UserID == CurrentApp.Session.UserID)
                        {
                            //PageParent.RefreshHeadIcon();
                        }
                        //end
                    }
                };
                mBackgroundWorker.RunWorkerCompleted += (s, re) =>
                {
                    mBackgroundWorker.Dispose();
                    if (PageParent != null)
                    {
                        PageParent.SetBusy(false, string.Empty);
                    }
                    if (mAsyncResult)
                    {
                        #region 写操作日志

                        CurrentApp.WriteOperationLog(S1101Consts.OPT_MODIFYUSER.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                        #endregion

                        if (PageParent != null)
                        {
                            PageParent.ReloadData(ObjParent);
                        }
                        var parent = Parent as PopupPanel;
                        if (parent != null)
                        {
                            parent.IsOpen = false;
                        }
                    }
                };
                mBackgroundWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
コード例 #29
0
        private bool CheckValues()
        {
            string description = this.TexDomainDescription.Text.Trim();
            string domainName  = this.TxtDomainName.Text.Trim();
            string username    = this.TxtUserName.Text.Trim();
            string password    = this.PassBoxUserPassword.Password.Trim();

            //1.域名称不能为空,且不重复,添加的时候在wcf里面判断
            //2.域账号和密码要可以查到域里的账号
            //3.域描述不能为空
            //4.密码不能有@
            //5.不能有大写字母
            if (domainName.Trim() == string.Empty)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1112T004", "域名为空"));
                return(false);
            }
            if (description.Trim() == string.Empty)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1112T005", "域描述为空"));
                return(false);
            }
            if (password.Trim().Equals("@"))
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1112T006", "密码不能有@字符"));
                return(false);
            }
            bool IsUsed = false;

            try
            {
                string IStrADPath = string.Format("LDAP://{0}", domainName);

                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S1112Codes.CheckDomainInfo;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(IStrADPath);
                webRequest.ListData.Add(username);
                webRequest.ListData.Add(password);

                Service11121Client client = new Service11121Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11121"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (webReturn.Result)
                {
                    IsUsed = true;
                }
                else
                {
                    CurrentApp.ShowExceptionMessage(string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("1112T007", "域连接出错"), webReturn.Message));
                }
            }
            catch (Exception ex)
            {
                //域不可用
                CurrentApp.ShowExceptionMessage(CurrentApp.GetLanguageInfo("1112T007", "域连接出错"));
                //S1112App.ShowExceptionMessage(string.Format("Get Users Info From LDAP Fail:{0}", ex.Message));
                CurrentApp.WriteLog(string.Format("Get all AD users fail.\t{0}", ex.Message));
                return(false);
            }
            if (IsAdd == 1)
            {
                domainInfo = new BasicDomainInfo();
            }
            domainInfo.Description        = description;
            domainInfo.DomainName         = domainName;
            domainInfo.DomainUserName     = username;
            domainInfo.DomainUserPassWord = password;
            domainInfo.IsActiveLogin      = this.CheckDomainActiveLogin.IsChecked == true ? true : false;
            //domainInfo.IsActive = true;
            //domainInfo.IsDelete = false;
            return(IsUsed);
        }
コード例 #30
0
 void ButnPrevious_Click(object sender, RoutedEventArgs e)
 {
     //下一页,进入回删归档参数配置界面
     CurrentApp.ShowInfoMessage("Over : )");
     MainPage.PopupPanel.IsOpen = false;
 }