コード例 #1
0
ファイル: SolutionItemForm.xaml.cs プロジェクト: jjg0519/OA
        private void LookUp_FindClick(object sender, EventArgs e)
        {
            string filter = "";
            ObservableCollection <object> paras = new ObservableCollection <object>();
            Dictionary <string, string>   cols  = new Dictionary <string, string>();

            cols.Add("SALARYITEMNAME", "SALARYITEMNAME");
            filter += "CREATECOMPANYID==@" + paras.Count().ToString();
            paras.Add(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
            LookupForm lookup = new LookupForm(EntityNames.SalaryItemSet,
                                               typeof(List <T_HR_SALARYITEM>), cols, filter, paras);

            lookup.TitleContent = Utility.GetResourceStr("SALARYITEM");

            lookup.SelectedClick += (o, ev) =>
            {
                T_HR_SALARYITEM ent = lookup.SelectedObj as T_HR_SALARYITEM;
                if (ent != null)
                {
                    salarySolutionItem.T_HR_SALARYITEM = new T_HR_SALARYITEM();
                    salarySolutionItem.T_HR_SALARYITEM.SALARYITEMID = ent.SALARYITEMID;
                    lkSolutionItem.DataContext = ent;
                }
            };
            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
コード例 #2
0
ファイル: CalculateItem.xaml.cs プロジェクト: jjg0519/OA
        void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            if (DtGrid.SelectedItems.Count > 0)
            {
                T_HR_SALARYITEM tmpStandard = DtGrid.SelectedItems[0] as T_HR_SALARYITEM;

                if (tmpStandard == null)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"));
                    return;
                }
                CalculateItemForm form    = new CalculateItemForm(FormTypes.Edit, tmpStandard.SALARYITEMID);
                EntityBrowser     browser = new EntityBrowser(form);

                browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                form.MinWidth            = 700;
                form.MinHeight           = 280;
                browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "EDIT"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "EDIT"));
            }
        }
コード例 #3
0
ファイル: CalculateItem.xaml.cs プロジェクト: jjg0519/OA
        /// <summary>
        /// 2012-8-24
        /// xiedx
        /// 初始化按钮
        /// </summary>
        void _ImgButtonExecuteSalaryItemSql_Click(object sender, RoutedEventArgs e)
        {
            string          Result = "";
            ComfirmWindow   com    = new ComfirmWindow();
            T_HR_SALARYITEM temp   = new T_HR_SALARYITEM();

            temp.SALARYITEMID = Guid.NewGuid().ToString();
            if (string.IsNullOrWhiteSpace(companyID))
            {
                temp.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                companyName         = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            }
            else
            {
                temp.OWNERCOMPANYID = companyID;
            }
            temp.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            temp.OWNERPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            temp.OWNERID           = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            temp.UPDATEUSERID      = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            com.OnSelectionBoxClosed += (obj, result) =>
            {
                ObservableCollection <string> ids = new ObservableCollection <string>();
                client.ExecuteSalaryItemSqlAsync(temp);
            };

            com.SelectionBox(Utility.GetResourceStr("CAUTION"), "该选项会初始化 " + companyName + " 的薪资,请向相关部门确认先", ComfirmWindow.titlename, Result);
        }
コード例 #4
0
ファイル: SalaryItemXmlOperator.cs プロジェクト: jjg0519/OA
        public static List <T_HR_SALARYITEM> GetSalaryItemXML()
        {
            List <T_HR_SALARYITEM> result = new List <T_HR_SALARYITEM>();
            Stream   stream   = Assembly.GetExecutingAssembly().GetManifestResourceStream("SMT.HRM.UI.EntitysXML.SalaryItemXML.xml");
            XElement xelement = XElement.Load(stream);
            var      xmls     = from ent in xelement.Elements()
                                select ent;

            foreach (var ent in xmls)
            {
                T_HR_SALARYITEM salaryitem = new T_HR_SALARYITEM();
                Type            type       = salaryitem.GetType();
                PropertyInfo[]  typePro    = type.GetProperties();
                foreach (var en in ent.Nodes())
                {
                    foreach (PropertyInfo prop in typePro)
                    {
                        if (prop.PropertyType.BaseType == typeof(EntityReference) || prop.PropertyType.BaseType == typeof(RelatedEnd))
                        {
                            continue;
                        }
                        try
                        {
                            if ((en as XElement).Name == prop.Name)
                            {
                                if (prop.Name.IndexOf("GUERDONSUM") != -1)
                                {
                                    prop.SetValue(salaryitem, Convert.ToDecimal((en as XElement).Value), null);
                                }
                                else
                                {
                                    prop.SetValue(salaryitem, (en as XElement).Value, null);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            ex.Message.ToString();
                        }
                    }
                }
                if (salaryitem != null)
                {
                    result.Add(salaryitem);
                }
            }
            return(result);
        }
コード例 #5
0
ファイル: StandardItemForm.xaml.cs プロジェクト: jjg0519/OA
        void btnNew_Click(object sender, RoutedEventArgs e)
        {
            string filter = "";
            ObservableCollection <object> paras = new ObservableCollection <object>();
            T_HR_SALARYSTANDARDITEM       salarystandarditem = new T_HR_SALARYSTANDARDITEM();
            T_HR_SALARYSTANDARD           salarystandard     = new T_HR_SALARYSTANDARD();

            salarystandard.SALARYSTANDARDID = savesid;
            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("SALARYITEMNAME", "SALARYITEMNAME");
            cols.Add("GUERDONSUM", "GUERDONSUM");
            cols.Add("CALCULATEFORMULA", "CALCULATEFORMULA");
            RefreshUI(RefreshedTypes.ProgressBar);
            filter += "CREATECOMPANYID==@" + paras.Count().ToString();
            paras.Add(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
            LookupForm lookup = new LookupForm(EntityNames.SalaryItemSet,
                                               typeof(List <T_HR_SALARYITEM>), cols, filter, paras);

            lookup.TitleContent   = Utility.GetResourceStr("SALARYITEM");
            lookup.SelectedClick += (o, ev) =>
            {
                T_HR_SALARYITEM ent = lookup.SelectedObj as T_HR_SALARYITEM;
                if (ent != null)
                {
                    salarystandarditem.STANDRECORDITEMID   = Guid.NewGuid().ToString();
                    salarystandarditem.T_HR_SALARYITEM     = ent;
                    salarystandarditem.T_HR_SALARYSTANDARD = salarystandard;
                    salarystandarditem.SUM          = ent.GUERDONSUM.ToString();
                    salarystandarditem.REMARK       = ent.REMARK;
                    salarystandarditem.CREATEDATE   = System.DateTime.Now;
                    salarystandarditem.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    client.SalaryStandardItemAddAsync(salarystandarditem);
                }
            };
            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });

            #region ----
            //System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();
            ////string filter = "";
            ////filter = "CHECKSTATE==@" + paras.Count;
            //paras.Add(Convert.ToInt16(CheckStates.Approved).ToString());
            //LookupForm lookup = new LookupForm(EntityNames.SalaryStandard,
            //  typeof(List<T_HR_SALARYSTANDARD>), cols, filter, paras);
            #endregion
        }
コード例 #6
0
ファイル: CalculateItemForm.xaml.cs プロジェクト: jjg0519/OA
        private void InitParas(string CalculateItemSetID)
        {
            client = new SalaryServiceClient();
            client.GetSalaryItemSetByIDCompleted += new EventHandler <GetSalaryItemSetByIDCompletedEventArgs>(client_GetSalaryItemSetByIDCompleted);
            client.SalaryItemSetAddCompleted     += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(client_SalaryItemSetAddCompleted);
            client.SalaryItemSetUpdateCompleted  += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(client_SalaryItemSetUpdateCompleted);

            if (FormType == FormTypes.New)
            {
                SalaryItemSet = new T_HR_SALARYITEM();
                SalaryItemSet.SALARYITEMID = Guid.NewGuid().ToString();
                //SalaryItemSet.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                SetToolBar();
            }
            else
            {
                client.GetSalaryItemSetByIDAsync(CalculateItemSetID);
            }
        }
コード例 #7
0
ファイル: CalculateItemForm.xaml.cs プロジェクト: JuRogn/OA
        private void InitParas(string CalculateItemSetID)
        {
            client = new SalaryServiceClient();
            client.GetSalaryItemSetByIDCompleted += new EventHandler<GetSalaryItemSetByIDCompletedEventArgs>(client_GetSalaryItemSetByIDCompleted);
            client.SalaryItemSetAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_SalaryItemSetAddCompleted);
            client.SalaryItemSetUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_SalaryItemSetUpdateCompleted);

            if (FormType == FormTypes.New)
            {
                SalaryItemSet = new T_HR_SALARYITEM();
                SalaryItemSet.SALARYITEMID = Guid.NewGuid().ToString();
                //SalaryItemSet.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                SetToolBar();
            }
            else
            {
                client.GetSalaryItemSetByIDAsync(CalculateItemSetID);
            }

        }
コード例 #8
0
ファイル: SalaryItemXmlOperator.cs プロジェクト: JuRogn/OA
 public static List<T_HR_SALARYITEM> GetSalaryItemXML()
 {
     List<T_HR_SALARYITEM> result = new List<T_HR_SALARYITEM>();
     Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SMT.HRM.UI.EntitysXML.SalaryItemXML.xml");  
     XElement xelement = XElement.Load(stream);
     var xmls = from ent in xelement.Elements()
                select ent;
     foreach (var ent in xmls)
     {
         T_HR_SALARYITEM salaryitem = new T_HR_SALARYITEM();
         Type type = salaryitem.GetType();
         PropertyInfo[] typePro = type.GetProperties();
         foreach (var en in ent.Nodes())
         {
             foreach (PropertyInfo prop in typePro)
             {
                 if (prop.PropertyType.BaseType == typeof(EntityReference) || prop.PropertyType.BaseType == typeof(RelatedEnd))
                     continue;
                 try
                 {
                     if ((en as XElement).Name == prop.Name)
                     {
                         if (prop.Name.IndexOf("GUERDONSUM")!=-1)
                             prop.SetValue(salaryitem, Convert.ToDecimal((en as XElement).Value), null);                                
                         else
                             prop.SetValue(salaryitem, (en as XElement).Value, null);
                     }
                 }
                 catch (Exception ex)
                 {
                     ex.Message.ToString();
                 }
             }
         }
         if (salaryitem != null) result.Add(salaryitem);
     }
     return result;
 }
コード例 #9
0
ファイル: Formulatemplate.xaml.cs プロジェクト: jjg0519/OA
        public void Init()
        {
            PARENT.Children.Add(loadbar);
            client.FormulaTemplateAddCompleted += new EventHandler <FormulaTemplateAddCompletedEventArgs>(client_FormulaTemplateAddCompleted);
            List <T_HR_SALARYITEM> salaryItemList = SalaryItemXmlOperator.GetSalaryItemXML();

            foreach (T_HR_SALARYITEM siList in salaryItemList)
            {
                T_HR_SALARYITEM list = siList;
                list.SALARYITEMID = Guid.NewGuid().ToString();
                list.CREATEDATE   = list.UPDATEDATE = System.DateTime.Now;

                list.OWNERCOMPANYID     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                list.OWNERDEPARTMENTID  = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                list.OWNERID            = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                list.OWNERPOSTID        = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                list.CREATEUSERID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                list.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                list.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                list.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                SalaryItemList.Add(list);
            }
        }
コード例 #10
0
ファイル: CalculateItem.xaml.cs プロジェクト: JuRogn/OA
        /// <summary>
        /// 2012-8-24
        /// xiedx
        /// 初始化按钮
        /// </summary>
        void _ImgButtonExecuteSalaryItemSql_Click(object sender, RoutedEventArgs e)
        {
            string Result = "";
            ComfirmWindow com = new ComfirmWindow();
            T_HR_SALARYITEM temp = new T_HR_SALARYITEM();
            temp.SALARYITEMID = Guid.NewGuid().ToString();
            if (string.IsNullOrWhiteSpace(companyID))
            {
                temp.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                companyName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            }
            else
            {
                temp.OWNERCOMPANYID = companyID;
            }
            temp.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            temp.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            temp.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            temp.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            com.OnSelectionBoxClosed += (obj, result) =>
            {
                ObservableCollection<string> ids = new ObservableCollection<string>();
                client.ExecuteSalaryItemSqlAsync(temp);
            };

            com.SelectionBox(Utility.GetResourceStr("CAUTION"), "该选项会初始化 "+companyName+" 的薪资,请向相关部门确认先", ComfirmWindow.titlename, Result);
        }
コード例 #11
0
ファイル: CalculateItemForm.xaml.cs プロジェクト: jjg0519/OA
        void client_GetSalaryItemSetByIDCompleted(object sender, GetSalaryItemSetByIDCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                if (e.Result != null)
                {
                    salaryItemSet    = e.Result;
                    this.DataContext = e.Result;
                    if (salaryItemSet.CALCULATORTYPE != string.Empty)
                    {
                        RBHAND.IsChecked = false;
                        //RBCHIVE.IsChecked = false;
                        RBFORMULA.IsChecked  = false;
                        SELECTITEM.IsChecked = false;
                    }
                    if (!string.IsNullOrEmpty(SalaryItemSet.MUSTSELECTED))
                    {
                        cbMustSelect.IsChecked = SalaryItemSet.MUSTSELECTED == "1" ? true : false;
                    }
                    if (!string.IsNullOrEmpty(SalaryItemSet.ISAUTOGENERATE))
                    {
                        cbLaterCal.IsChecked = SalaryItemSet.ISAUTOGENERATE == "1" ? true : false;
                    }
                    switch (salaryItemSet.CALCULATORTYPE)
                    {
                    case "1":
                        RBHAND.IsChecked     = true;
                        cbLaterCal.IsEnabled = false;
                        cbLaterCal.IsChecked = false;
                        break;

                    //case "2":
                    //    RBCHIVE.IsChecked = true;
                    //    cbLaterCal.IsEnabled = false;
                    //    cbLaterCal.IsChecked = false;
                    //    break;
                    case "3":
                        RBFORMULA.IsChecked  = true;
                        cbLaterCal.IsEnabled = true;
                        if (string.IsNullOrEmpty(salaryItemSet.CALCULATEFORMULACODE))
                        {
                            txtCalculateCode.Text = "-1";
                        }
                        LoadEntityList();
                        break;

                    case "4":
                        SELECTITEM.IsChecked = true;
                        cbLaterCal.IsEnabled = false;
                        cbLaterCal.IsEnabled = false;
                        LoadEntityList();
                        break;
                    }
                }
            }
            SetToolBar();
        }
コード例 #12
0
ファイル: SalaryService.svc.cs プロジェクト: fuhongliang/oa
 public void ExecuteSalaryItemSql(T_HR_SALARYITEM salaryItem)
 {
     using (SalaryItemSetBLL bll = new SalaryItemSetBLL())
     {
        bll.ExecuteSalaryItemSql(salaryItem);
     }
 }
コード例 #13
0
ファイル: SalaryService.svc.cs プロジェクト: fuhongliang/oa
 public void SalaryItemSetUpdate(T_HR_SALARYITEM entity)
 {
     using (SalaryItemSetBLL bll = new SalaryItemSetBLL())
     {
         bll.SalaryItemSetUpdate(entity);
     }
 }
コード例 #14
0
ファイル: SalaryService.svc.cs プロジェクト: fuhongliang/oa
 public bool FormulaTemplateAdd(T_HR_SALARYITEM[] entitys)
 {
     using (SalaryItemSetBLL bll = new SalaryItemSetBLL())
     {
         return bll.FormulaTemplateAdd(entitys);
     }
 }
コード例 #15
0
ファイル: SalaryService.svc.cs プロジェクト: fuhongliang/oa
 public void SalaryItemSetAdd(T_HR_SALARYITEM entity)
 {
     using (SalaryItemSetBLL bll = new SalaryItemSetBLL())
     {
         bll.Add(entity);
     }
 }
コード例 #16
0
ファイル: CalculateItemForm.xaml.cs プロジェクト: JuRogn/OA
        void client_GetSalaryItemSetByIDCompleted(object sender, GetSalaryItemSetByIDCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
            else
            {
                if (e.Result != null)
                {
                    salaryItemSet = e.Result;
                    this.DataContext = e.Result;
                    if (salaryItemSet.CALCULATORTYPE != string.Empty)
                    {
                        RBHAND.IsChecked = false;
                        //RBCHIVE.IsChecked = false;
                        RBFORMULA.IsChecked = false;
                        SELECTITEM.IsChecked = false;
                    }
                    if (!string.IsNullOrEmpty(SalaryItemSet.MUSTSELECTED))
                        cbMustSelect.IsChecked = SalaryItemSet.MUSTSELECTED == "1" ? true : false;
                    if (!string.IsNullOrEmpty(SalaryItemSet.ISAUTOGENERATE))
                        cbLaterCal.IsChecked = SalaryItemSet.ISAUTOGENERATE == "1" ? true : false;
                    switch (salaryItemSet.CALCULATORTYPE)
                    {
                        case "1":
                            RBHAND.IsChecked = true;
                            cbLaterCal.IsEnabled = false;
                            cbLaterCal.IsChecked = false;
                            break;
                        //case "2":
                        //    RBCHIVE.IsChecked = true;
                        //    cbLaterCal.IsEnabled = false;
                        //    cbLaterCal.IsChecked = false;
                        //    break;
                        case "3":
                            RBFORMULA.IsChecked = true;
                            cbLaterCal.IsEnabled = true;
                            if (string.IsNullOrEmpty(salaryItemSet.CALCULATEFORMULACODE))
                            {
                                txtCalculateCode.Text = "-1";
                            }
                            LoadEntityList();
                            break;
                        case "4":
                            SELECTITEM.IsChecked = true;
                            cbLaterCal.IsEnabled = false;
                            cbLaterCal.IsEnabled = false;
                            LoadEntityList();
                            break;
                    }

                }
            }
            SetToolBar();
        }