Exemplo n.º 1
0
        /// <summary>
        /// 将存储于OrganizationWS服务下T_HR_ATTENDANCEDEDUCTMASTER实体的数据,复制后改存到AttendanceWS服务下T_HR_ATTENDANCEDEDUCTMASTER实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        private T_HR_ATTENDANCEDEDUCTMASTER ReplicateDataToNewStructure(SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER ent)
        {
            T_HR_ATTENDANCEDEDUCTMASTER entTemp = new T_HR_ATTENDANCEDEDUCTMASTER();

            if (ent == null)
            {
                return(null);
            }

            entTemp.DEDUCTMASTERID            = ent.DEDUCTMASTERID;
            entTemp.ATTENDABNORMALTYPE        = ent.ATTENDABNORMALTYPE;
            entTemp.FINETYPE                  = ent.FINETYPE;
            entTemp.PARAMETERVALUE            = ent.PARAMETERVALUE;
            entTemp.FINERATIO                 = ent.FINERATIO;
            entTemp.ISACCUMULATING            = ent.ISACCUMULATING;
            entTemp.FINESUM                   = ent.FINESUM;
            entTemp.ISPERFECTATTENDANCEFACTOR = ent.ISPERFECTATTENDANCEFACTOR;
            entTemp.REMARK       = ent.REMARK;
            entTemp.CREATEUSERID = ent.CREATEUSERID;
            entTemp.CREATEDATE   = ent.CREATEDATE;
            entTemp.UPDATEUSERID = ent.UPDATEUSERID;
            entTemp.UPDATEDATE   = ent.UPDATEDATE;

            return(entTemp);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 删除指定的考勤异常扣款设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (dgAttendanceDeductlist.SelectedItems == null)
            {
                return;
            }

            //ObservableCollection<SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER> entList = Utility.Clone<ObservableCollection<SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER>>(dgAttendanceDeductlist.ItemsSource as ObservableCollection<SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER>);
            ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER> entList = dgAttendanceDeductlist.ItemsSource as ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER>;

            ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER> entTemps = new ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER>();

            for (int i = 0; i < dgAttendanceDeductlist.SelectedItems.Count; i++)
            {
                entTemps.Add(dgAttendanceDeductlist.SelectedItems[i] as T_HR_ATTENDANCEDEDUCTMASTER);
            }

            int iSel = entTemps.Count;

            for (int i = 0; i < iSel; i++)
            {
                T_HR_ATTENDANCEDEDUCTMASTER entTemp = entTemps[i] as T_HR_ATTENDANCEDEDUCTMASTER;

                for (int j = 0; j < entList.Count; j++)
                {
                    if (entList[j].DEDUCTMASTERID == entTemp.DEDUCTMASTERID)
                    {
                        entList.RemoveAt(j);
                    }
                }
            }

            dgAttendanceDeductlist.ItemsSource = entList;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 删除指定假期记录(物理删除,待定)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            string strID = "";

            if (dgAttDedMasSetList.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

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

            foreach (object ovj in dgAttDedMasSetList.SelectedItems)
            {
                T_HR_ATTENDANCEDEDUCTMASTER ent = ovj as T_HR_ATTENDANCEDEDUCTMASTER;
                string Result = "";
                if (ent != null)
                {
                    strID = ent.DEDUCTMASTERID.ToString();
                    ComfirmWindow delComfirm = new ComfirmWindow();
                    delComfirm.OnSelectionBoxClosed += (obj, result) =>
                    {
                        clientAtt.RemoveAttendanceDeductMasterAsync(strID);
                    };
                    delComfirm.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 弹出表单子窗口,以便编辑考勤异常扣款定义
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            string strAttendanceDeductMasterId = string.Empty;

            if (dgAttDedMasSetList.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "EDIT"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

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

            T_HR_ATTENDANCEDEDUCTMASTER ent = dgAttDedMasSetList.SelectedItems[0] as T_HR_ATTENDANCEDEDUCTMASTER;

            strAttendanceDeductMasterId = ent.DEDUCTMASTERID.ToString();
            AttendanceDeductMasterForm formAttDedMas = new AttendanceDeductMasterForm(FormTypes.Edit, strAttendanceDeductMasterId);
            EntityBrowser entBrowser = new EntityBrowser(formAttDedMas);

            formAttDedMas.MinWidth      = 630;
            formAttDedMas.MinHeight     = 580;
            entBrowser.FormType         = FormTypes.Edit;
            entBrowser.ReloadDataEvent += new EntityBrowser.refreshGridView(entBrowser_ReloadDataEvent);
            entBrowser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据主键索引,获得指定的假期记录以便查看编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void clientAtt_GetAttendanceDeductMasterByIDCompleted(object sender, GetAttendanceDeductMasterByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                entAttendanceDeductMaster = e.Result;
                this.DataContext          = entAttendanceDeductMaster;

                if (entAttendanceDeductMaster != null)
                {
                    cbxIsAccumulating.IsChecked = false;
                    if (entAttendanceDeductMaster.ISACCUMULATING == (Convert.ToInt32(IsChecked.Yes) + 1).ToString())
                    {
                        cbxIsAccumulating.IsChecked = true;
                    }

                    cbxIsPerfectAttendanceFactor.IsChecked = false;
                    if (entAttendanceDeductMaster.ISPERFECTATTENDANCEFACTOR == (Convert.ToInt32(IsChecked.Yes) + 1).ToString())
                    {
                        cbxIsPerfectAttendanceFactor.IsChecked = true;
                    }

                    BindDeductDetail();

                    toolbar1.IsEnabled = true;  //设置按钮可用,以便对主表关联明细表数据进行管理
                }

                SetToolBar();
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 表单初始化
        /// </summary>
        private void InitForm()
        {
            entAttendanceDeductMaster = new T_HR_ATTENDANCEDEDUCTMASTER();
            entAttendanceDeductMaster.DEDUCTMASTERID = System.Guid.NewGuid().ToString().ToUpper();

            //权限控制
            entAttendanceDeductMaster.OWNERCOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            entAttendanceDeductMaster.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            entAttendanceDeductMaster.OWNERPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            entAttendanceDeductMaster.OWNERID           = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            //2010年2月11日, 11:37:35,目前暂未实现登录部分,人员相关数据为假定值
            entAttendanceDeductMaster.CREATEDATE   = DateTime.Now;
            entAttendanceDeductMaster.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            entAttendanceDeductMaster.UPDATEDATE   = System.DateTime.Now;
            entAttendanceDeductMaster.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            //页面初始化加载的临时数据
            entAttendanceDeductMaster.ATTENDABNORMALTYPE        = "0";
            entAttendanceDeductMaster.ISACCUMULATING            = "0";
            entAttendanceDeductMaster.ISPERFECTATTENDANCEFACTOR = "0";
            entAttendanceDeductMaster.FINETYPE = "0";

            this.DataContext = entAttendanceDeductMaster;
        }
Exemplo n.º 7
0
        public AttendanceDeductDetailForm(FormTypes formtype, string strDeductDetailID, T_HR_ATTENDANCEDEDUCTMASTER entAttendanceDeductMaster)
        {
            FormType = formtype;
            DeductDetailID = strDeductDetailID;
            AttendanceDeductMaster = entAttendanceDeductMaster;
            InitializeComponent();
            RegisterEvents();

            this.Loaded += new RoutedEventHandler(AttendanceDeductDetailForm_Loaded);
        }        
Exemplo n.º 8
0
        public AttendanceDeductDetailForm(FormTypes formtype, string strDeductDetailID, T_HR_ATTENDANCEDEDUCTMASTER entAttendanceDeductMaster)
        {
            FormType               = formtype;
            DeductDetailID         = strDeductDetailID;
            AttendanceDeductMaster = entAttendanceDeductMaster;
            InitializeComponent();
            RegisterEvents();

            this.Loaded += new RoutedEventHandler(AttendanceDeductDetailForm_Loaded);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 显示考勤异常扣款的设置记录列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addNewDeduct()
        {
            Dictionary <string, string> cols = new Dictionary <string, string>();

            cols.Add("ATTENDABNORMALNAME", "ATTENDABNORMALNAME");
            cols.Add("ISACCUMULATING", "ISACCUMULATING,ISCHECKED,DICTIONARYCONVERTER");
            cols.Add("ISPERFECTATTENDANCEFACTOR", "ISPERFECTATTENDANCEFACTOR,ISCHECKED,DICTIONARYCONVERTER");

            LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.AttendanceDeductMaster,
                                               typeof(SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER[]), cols);

            lookup.SelectedClick += (o, ev) =>
            {
                SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER ent = lookup.SelectedObj as SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER;

                if (ent != null)
                {
                    T_HR_ATTENDANCEDEDUCTMASTER entView = ReplicateDataToNewStructure(ent);
                    ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER> entList = new ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER>();
                    if (entView == null)
                    {
                        return;
                    }

                    if (dgAttendanceDeductlist.ItemsSource != null)
                    {
                        entList = dgAttendanceDeductlist.ItemsSource as ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER>;
                        bool flag = false;
                        flag = IsContainsEntity(entList, entView);

                        if (flag)
                        {
                            return;
                        }
                    }

                    entList.Add(entView);
                    dgAttendanceDeductlist.ItemsSource = entList;
                }
            };

            lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 10
0
        void BtnView_Click(object sender, RoutedEventArgs e)
        {
            if (dgAttendanceDeductlist.SelectedItems == null)
            {
                return;
            }

            if (dgAttendanceDeductlist.SelectedItems.Count == 0)
            {
                return;
            }

            T_HR_ATTENDANCEDEDUCTMASTER tmpEnt = dgAttendanceDeductlist.SelectedItems[0] as T_HR_ATTENDANCEDEDUCTMASTER;

            string strAttendanceDeductMasterId       = tmpEnt.DEDUCTMASTERID.ToString();
            AttendanceDeductMasterForm formAttDedMas = new AttendanceDeductMasterForm(FormTypes.Edit, strAttendanceDeductMasterId);
            EntityBrowser entBrowser = new EntityBrowser(formAttDedMas);

            entBrowser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
        }
Exemplo n.º 11
0
 public string ModifyAttendanceDeductMaster(T_HR_ATTENDANCEDEDUCTMASTER entRd)
 {
     using (AttendanceDeductMasterBLL bllAttendanceDeductMaster = new AttendanceDeductMasterBLL())
     {
         return bllAttendanceDeductMaster.ModifyDeductMaster(entRd);
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// 检测DataGrid是否存在重复记录
        /// </summary>
        /// <param name="entList"></param>
        /// <param name="entView"></param>
        /// <returns></returns>
        private bool IsContainsEntity(ObservableCollection <T_HR_ATTENDANCEDEDUCTMASTER> entList, T_HR_ATTENDANCEDEDUCTMASTER entView)
        {
            bool flag = false;

            var q = from item in entList
                    where item.ATTENDABNORMALTYPE == entView.ATTENDABNORMALTYPE
                    select item;

            if (q.Count() == 0)
            {
                return(flag);
            }

            flag = true;

            return(flag);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 检测DataGrid是否存在重复记录
        /// </summary>
        /// <param name="entList"></param>
        /// <param name="entView"></param>
        /// <returns></returns>
        private bool IsContainsEntity(ObservableCollection<T_HR_ATTENDANCEDEDUCTMASTER> entList, T_HR_ATTENDANCEDEDUCTMASTER entView)
        {
            bool flag = false;

            var q = from item in entList
                    where item.ATTENDABNORMALTYPE == entView.ATTENDABNORMALTYPE
                    select item;

            if (q.Count() == 0)
            {
                return flag;
            }

            flag = true;

            return flag;
        }
Exemplo n.º 14
0
        /// <summary>
        /// 将存储于OrganizationWS服务下T_HR_ATTENDANCEDEDUCTMASTER实体的数据,复制后改存到AttendanceWS服务下T_HR_ATTENDANCEDEDUCTMASTER实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        private T_HR_ATTENDANCEDEDUCTMASTER ReplicateDataToNewStructure(SMT.Saas.Tools.OrganizationWS.T_HR_ATTENDANCEDEDUCTMASTER ent)
        {
            T_HR_ATTENDANCEDEDUCTMASTER entTemp = new T_HR_ATTENDANCEDEDUCTMASTER();
            if (ent == null)
            {
                return null;
            }

            entTemp.DEDUCTMASTERID = ent.DEDUCTMASTERID;
            entTemp.ATTENDABNORMALTYPE = ent.ATTENDABNORMALTYPE;
            entTemp.FINETYPE = ent.FINETYPE;
            entTemp.PARAMETERVALUE = ent.PARAMETERVALUE;
            entTemp.FINERATIO = ent.FINERATIO;
            entTemp.ISACCUMULATING = ent.ISACCUMULATING;
            entTemp.FINESUM = ent.FINESUM;
            entTemp.ISPERFECTATTENDANCEFACTOR = ent.ISPERFECTATTENDANCEFACTOR;
            entTemp.REMARK = ent.REMARK;
            entTemp.CREATEUSERID = ent.CREATEUSERID;
            entTemp.CREATEDATE = ent.CREATEDATE;
            entTemp.UPDATEUSERID = ent.UPDATEUSERID;
            entTemp.UPDATEDATE = ent.UPDATEDATE;

            return entTemp;
        }
Exemplo n.º 15
0
        /// <summary>
        /// 根据主键索引,获得指定的假期记录以便查看编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void clientAtt_GetAttendanceDeductMasterByIDCompleted(object sender, GetAttendanceDeductMasterByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                entAttendanceDeductMaster = e.Result;
                this.DataContext = entAttendanceDeductMaster;

                if (entAttendanceDeductMaster != null)
                {
                    cbxIsAccumulating.IsChecked = false;
                    if (entAttendanceDeductMaster.ISACCUMULATING == (Convert.ToInt32(IsChecked.Yes) + 1).ToString())
                    {
                        cbxIsAccumulating.IsChecked = true;
                    }

                    cbxIsPerfectAttendanceFactor.IsChecked = false;
                    if (entAttendanceDeductMaster.ISPERFECTATTENDANCEFACTOR == (Convert.ToInt32(IsChecked.Yes) + 1).ToString())
                    {
                        cbxIsPerfectAttendanceFactor.IsChecked = true;
                    }                    

                    BindDeductDetail();

                    toolbar1.IsEnabled = true;  //设置按钮可用,以便对主表关联明细表数据进行管理
                }
                
                SetToolBar();
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 表单初始化
        /// </summary>
        private void InitForm()
        {
            entAttendanceDeductMaster = new T_HR_ATTENDANCEDEDUCTMASTER();
            entAttendanceDeductMaster.DEDUCTMASTERID = System.Guid.NewGuid().ToString().ToUpper();

            //权限控制
            entAttendanceDeductMaster.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            entAttendanceDeductMaster.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            entAttendanceDeductMaster.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            entAttendanceDeductMaster.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            //2010年2月11日, 11:37:35,目前暂未实现登录部分,人员相关数据为假定值
            entAttendanceDeductMaster.CREATEDATE = DateTime.Now;
            entAttendanceDeductMaster.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            entAttendanceDeductMaster.UPDATEDATE = System.DateTime.Now;
            entAttendanceDeductMaster.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            //页面初始化加载的临时数据
            entAttendanceDeductMaster.ATTENDABNORMALTYPE = "0";
            entAttendanceDeductMaster.ISACCUMULATING = "0";
            entAttendanceDeductMaster.ISPERFECTATTENDANCEFACTOR = "0";
            entAttendanceDeductMaster.FINETYPE = "0";

            this.DataContext = entAttendanceDeductMaster;
        }