示例#1
0
 private void InitData()
 {
     if (actions == FormTypes.New)
     {
         AgentSetInfo                  = new T_OA_AGENTDATESET();
         this.dEFFECTDATE.Text         = DateTime.Now.ToShortDateString();          //生效日期
         this.dPLANEXPIRATIONDATE.Text = DateTime.Now.ToShortDateString();          //计划失效日期
         this.dINVALIDDATE.Text        = string.Empty;                              //失效日期
         this.dINVALIDDATE.IsEnabled   = false;
         client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID); //获取当期用户信息
     }
     else
     {
         if (string.IsNullOrEmpty(AgentSetID))
         {
             this.DataContext = AgentSetInfo;
         }
         else
         {
             SoaChannel.GetAgentDataSetBysIdAsync(AgentSetID);
         }
         this.dINVALIDDATE.IsEnabled = true;
         cbModelCode.Visibility      = Visibility.Visible; //隐藏ModeCode的下拉框
         txtAGENTMODULE.Visibility   = Visibility.Visible; //显示ModeCode的文本框
     }
     if (actions == FormTypes.Browse)
     {
         this.dEFFECTDATE.IsEnabled         = false;
         this.dINVALIDDATE.IsEnabled        = false;
         this.dPLANEXPIRATIONDATE.IsEnabled = false;
         this.txtAGENTMODULE.IsEnabled      = false;
         this.cbSYSTEMTYPE.IsEnabled        = false;
     }
 }
示例#2
0
        void BtnView_Click(object sender, RoutedEventArgs e)
        {
            if (DaGr.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            T_OA_AGENTDATESET ent = DaGr.SelectedItems[0] as T_OA_AGENTDATESET;

            AgentAgingSetForm AddWin  = new AgentAgingSetForm(FormTypes.Browse, ent.AGENTDATESETID);
            EntityBrowser     browser = new EntityBrowser(AddWin);

            browser.FormType         = FormTypes.Browse;
            browser.MinWidth         = 500;
            browser.MinHeight        = 220;
            browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
            browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
        }
示例#3
0
        void TravelapplicationPage_Click(object sender, RoutedEventArgs e)
        {
            string strLeaveTypeSetID = string.Empty;

            if (DaGr.SelectedItems == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                return;
            }

            if (DaGr.SelectedItems.Count == 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                return;
            }

            for (int i = 0; i < DaGr.SelectedItems.Count; i++)
            {
                T_OA_AGENTDATESET ent = DaGr.SelectedItems[i] as T_OA_AGENTDATESET;

                AgentAgingSetForm AddWin  = new AgentAgingSetForm(FormTypes.Edit, ent.AGENTDATESETID);
                EntityBrowser     browser = new EntityBrowser(AddWin);
                browser.FormType         = FormTypes.Edit;
                browser.MinWidth         = 550;
                browser.MinHeight        = 220;
                browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { });
            }
        }
示例#4
0
 private void InitData()
 {
     if (actions == FormTypes.New)
     {
         AgentSetInfo = new T_OA_AGENTDATESET();
         this.dEFFECTDATE.Text = DateTime.Now.ToShortDateString();//生效日期
         this.dPLANEXPIRATIONDATE.Text = DateTime.Now.ToShortDateString();//计划失效日期
         this.dINVALIDDATE.Text = string.Empty;//失效日期
         this.dINVALIDDATE.IsEnabled = false;
         client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID);//获取当期用户信息
     }
     else
     {
         if (string.IsNullOrEmpty(AgentSetID))
         {
             this.DataContext = AgentSetInfo;
         }
         else
         {
             SoaChannel.GetAgentDataSetBysIdAsync(AgentSetID);
         }
         this.dINVALIDDATE.IsEnabled = true;
         cbModelCode.Visibility = Visibility.Visible;//隐藏ModeCode的下拉框
         txtAGENTMODULE.Visibility = Visibility.Visible;//显示ModeCode的文本框
     }
     if (actions == FormTypes.Browse)
     {
         this.dEFFECTDATE.IsEnabled = false;
         this.dINVALIDDATE.IsEnabled = false;
         this.dPLANEXPIRATIONDATE.IsEnabled = false;
         this.txtAGENTMODULE.IsEnabled = false;
         this.cbSYSTEMTYPE.IsEnabled = false;
     }
 }
示例#5
0
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            agentsetId = new ObservableCollection <string>();
            if (DaGr.SelectedItems.Count > 0)
            {
                for (int i = 0; i < DaGr.SelectedItems.Count; i++)
                {
                    T_OA_AGENTDATESET ent = DaGr.SelectedItems[i] as T_OA_AGENTDATESET;

                    agentsetId.Add((DaGr.SelectedItems[i] as T_OA_AGENTDATESET).AGENTDATESETID);

                    string        Result = "";
                    ComfirmWindow com    = new ComfirmWindow();
                    com.OnSelectionBoxClosed += (obj, result) =>
                    {
                        SoaChannel.DeleteAgentDataSetAsync(agentsetId);
                        LoadData();
                    };
                    com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }
示例#6
0
 public T_OA_AGENTDATESET GetAgentDataSetBysId(string AgentDataSetId)
 {
     using (AgentAgingSetBLL aasbll = new AgentAgingSetBLL())
     {
         T_OA_AGENTDATESET AgentDataSetById = aasbll.GetAgentDataSetBysId(AgentDataSetId);
         return(AgentDataSetById == null ? null : AgentDataSetById);
     }
 }
示例#7
0
 [OperationContract]//更新代理设置
 public string UpdateAgentDataSet(T_OA_AGENTDATESET AgentSet)
 {
     using (AgentAgingSetBLL aasbll = new AgentAgingSetBLL())
     {
         string returnStr = "";
         if (!aasbll.UpdateAgentDateSet(AgentSet))
         {
             returnStr = "更新数据失败!";
         }
         return(returnStr);
     }
 }
示例#8
0
 [OperationContract]//添加代理设置信息
 public string AgentDataSetAdd(T_OA_AGENTDATESET AgentDataSet)
 {
     using (AgentAgingSetBLL aasbll = new AgentAgingSetBLL())
     {
         string returnStr = "";
         if (!aasbll.IsExistAgentDateSet(AgentDataSet.MODELCODE, AgentDataSet.OWNERCOMPANYID))
         {
             if (!aasbll.AgentDateSetAdd(AgentDataSet))
             {
                 returnStr = "添加数据失败";
             }
         }
         else
         {
             returnStr = "该数据已经存在,添加失败";
         }
         return(returnStr);
     }
 }
示例#9
0
 private void AddAgent(int i)
 {
     AgentDateSet = new T_OA_AGENTDATESET();
     AgentDateSet.AGENTDATESETID     = Master_Golbal.BUSINESSTRIPID;                                 //出差ID
     AgentDateSet.USERID             = Master_Golbal.OWNERID;                                        //出差人ID
     AgentDateSet.MODELCODE          = "T_OA_BUSINESSTRIP";                                          //模块代码
     AgentDateSet.EFFECTIVEDATE      = Convert.ToDateTime(TraveDetailList_Golbal[0].STARTDATE).Date; //生效时间
     AgentDateSet.PLANEXPIRATIONDATE = Convert.ToDateTime(TraveDetailList_Golbal[i].ENDDATE).Date;   //计划失效时间
     AgentDateSet.OWNERID            = Master_Golbal.OWNERID;                                        //所属人ID
     AgentDateSet.OWNERNAME          = Master_Golbal.OWNERNAME;                                      //所属用户名称
     AgentDateSet.OWNERPOSTID        = Master_Golbal.OWNERPOSTID;                                    //所属岗位ID
     AgentDateSet.OWNERDEPARTMENTID  = Master_Golbal.OWNERDEPARTMENTID;                              //所属部门ID
     AgentDateSet.OWNERCOMPANYID     = Master_Golbal.OWNERCOMPANYID;                                 //所属公司ID
     AgentDateSet.CREATEUSERID       = Master_Golbal.CREATEUSERID;                                   //创建人ID
     AgentDateSet.CREATEUSERNAME     = Master_Golbal.CREATEUSERNAME;                                 //创建人姓名
     AgentDateSet.CREATEPOSTID       = Master_Golbal.OWNERPOSTID;                                    //创建岗位ID
     AgentDateSet.CREATEDEPARTMENTID = Master_Golbal.OWNERDEPARTMENTID;                              //创建部门ID
     AgentDateSet.CREATECOMPANYID    = Master_Golbal.OWNERCOMPANYID;                                 //创建公司ID
     AgentDateSet.CREATEDATE         = Convert.ToDateTime(Master_Golbal.UPDATEDATE);
 }
示例#10
0
 private void AddAgent(int i)
 {
     AgentDateSet = new T_OA_AGENTDATESET();
     AgentDateSet.AGENTDATESETID = Master_Golbal.BUSINESSTRIPID;//出差ID
     AgentDateSet.USERID = Master_Golbal.OWNERID;//出差人ID
     AgentDateSet.MODELCODE = "T_OA_BUSINESSTRIP";//模块代码
     AgentDateSet.EFFECTIVEDATE = Convert.ToDateTime(TraveDetailList_Golbal[0].STARTDATE).Date;//生效时间
     AgentDateSet.PLANEXPIRATIONDATE = Convert.ToDateTime(TraveDetailList_Golbal[i].ENDDATE).Date;//计划失效时间
     AgentDateSet.OWNERID = Master_Golbal.OWNERID;//所属人ID
     AgentDateSet.OWNERNAME = Master_Golbal.OWNERNAME;//所属用户名称
     AgentDateSet.OWNERPOSTID = Master_Golbal.OWNERPOSTID;//所属岗位ID
     AgentDateSet.OWNERDEPARTMENTID = Master_Golbal.OWNERDEPARTMENTID;//所属部门ID
     AgentDateSet.OWNERCOMPANYID = Master_Golbal.OWNERCOMPANYID;//所属公司ID
     AgentDateSet.CREATEUSERID = Master_Golbal.CREATEUSERID;//创建人ID
     AgentDateSet.CREATEUSERNAME = Master_Golbal.CREATEUSERNAME;//创建人姓名
     AgentDateSet.CREATEPOSTID = Master_Golbal.OWNERPOSTID;//创建岗位ID
     AgentDateSet.CREATEDEPARTMENTID = Master_Golbal.OWNERDEPARTMENTID;//创建部门ID
     AgentDateSet.CREATECOMPANYID = Master_Golbal.OWNERCOMPANYID;//创建公司ID
     AgentDateSet.CREATEDATE = Convert.ToDateTime(Master_Golbal.UPDATEDATE);
 }
示例#11
0
        void SoaChannel_GetAgentDataSetBysIdCompleted(object sender, GetAgentDataSetBysIdCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        AgentSetInfo     = e.Result;
                        this.DataContext = AgentSetInfo;
                        //将模块代码、生效时间、计划生效时间控件设为只读
                        this.dEFFECTDATE.IsEnabled         = false;
                        this.dPLANEXPIRATIONDATE.IsEnabled = false;
                        this.txtAGENTMODULE.IsEnabled      = false;
                        //如果代理已经关闭,将失效时间控件设为只读
                        if (AgentSetInfo.EXPIRATIONDATE != null)
                        {
                            this.dINVALIDDATE.IsEnabled = false;
                        }

                        txtAGENTMODULE.Text      = Utility.GetMododuelName(AgentSetInfo.MODELCODE);
                        dEFFECTDATE.Text         = AgentSetInfo.EFFECTIVEDATE.ToShortDateString();
                        dINVALIDDATE.Text        = AgentSetInfo.EXPIRATIONDATE.ToString();
                        dPLANEXPIRATIONDATE.Text = AgentSetInfo.PLANEXPIRATIONDATE.ToShortDateString();

                        Party.Add(AgentSetInfo.USERID);
                        client.GetEmployeeByIDsAsync(Party);

                        client.GetEmployeeDetailByIDAsync(AgentSetInfo.USERID);
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }
示例#12
0
 [OperationContract]//添加代理设置信息
 public string AgentDataSetAdd(T_OA_AGENTDATESET AgentDataSet)
 {
     using (AgentAgingSetBLL aasbll = new AgentAgingSetBLL())
     {
         string returnStr = "";
         if (!aasbll.IsExistAgentDateSet(AgentDataSet.MODELCODE, AgentDataSet.OWNERCOMPANYID))
         {
             if (!aasbll.AgentDateSetAdd(AgentDataSet))
             {
                 returnStr = "添加数据失败";
             }
         }
         else
         {
             returnStr = "该数据已经存在,添加失败";
         }
         return returnStr;
     }
 }
示例#13
0
 [OperationContract]//更新代理设置
 public string UpdateAgentDataSet(T_OA_AGENTDATESET AgentSet)
 {
     using (AgentAgingSetBLL aasbll = new AgentAgingSetBLL())
     {
         string returnStr = "";
         if (!aasbll.UpdateAgentDateSet(AgentSet))
         {
             returnStr = "更新数据失败!";
         }
         return returnStr;
     }
 }
示例#14
0
        void SoaChannel_GetAgentDataSetBysIdCompleted(object sender, GetAgentDataSetBysIdCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        AgentSetInfo = e.Result;
                        this.DataContext = AgentSetInfo;
                        //将模块代码、生效时间、计划生效时间控件设为只读
                        this.dEFFECTDATE.IsEnabled = false;
                        this.dPLANEXPIRATIONDATE.IsEnabled = false;
                        this.txtAGENTMODULE.IsEnabled = false;
                        //如果代理已经关闭,将失效时间控件设为只读
                        if (AgentSetInfo.EXPIRATIONDATE != null)
                        {
                            this.dINVALIDDATE.IsEnabled = false;
                        }

                        txtAGENTMODULE.Text = Utility.GetMododuelName(AgentSetInfo.MODELCODE);
                        dEFFECTDATE.Text = AgentSetInfo.EFFECTIVEDATE.ToShortDateString();
                        dINVALIDDATE.Text = AgentSetInfo.EXPIRATIONDATE.ToString();
                        dPLANEXPIRATIONDATE.Text = AgentSetInfo.PLANEXPIRATIONDATE.ToShortDateString();

                        Party.Add(AgentSetInfo.USERID);
                        client.GetEmployeeByIDsAsync(Party);

                        client.GetEmployeeDetailByIDAsync(AgentSetInfo.USERID);
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }