Exemple #1
0
 public void CompanyHistoryAdd(T_HR_COMPANYHISTORY entity)
 {
     using (CompanyHistoryBLL bll = new CompanyHistoryBLL())
     {
         bll.CompanyHistoryAdd(entity);
     }
 }
Exemple #2
0
        private void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Button btnFind = Utility.FindChildControl <Button>(expander, "btnFind");

            if (btnFind != null)
            {
                btnFind.IsEnabled = false;
            }
            DtGrid.IsEnabled = false;
            T_HR_COMPANYHISTORY ent = ((System.Windows.Controls.DataGrid)(sender)).SelectedItem as T_HR_COMPANYHISTORY;

            client.GetCompanyHistoryAsync(ent.REUSEDATE.GetValueOrDefault());
        }
Exemple #3
0
        private TreeViewItem GetParentItemFromChild1(TreeViewItem item, string parentType, string parentID)
        {
            TreeViewItem tmpItem = null;

            if (item.Tag != null && item.Tag.ToString() == parentType)
            {
                switch (parentType)
                {
                case "0":
                    T_HR_COMPANYHISTORY tmpOrg = item.DataContext as T_HR_COMPANYHISTORY;
                    if (tmpOrg != null)
                    {
                        if (tmpOrg.COMPANYID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;

                case "1":
                    T_HR_DEPARTMENTHISTORY tmpDep = item.DataContext as T_HR_DEPARTMENTHISTORY;
                    if (tmpDep != null)
                    {
                        if (tmpDep.DEPARTMENTID == parentID)
                        {
                            return(item);
                        }
                    }
                    break;
                }
            }
            if (item.Items != null && item.Items.Count > 0)
            {
                foreach (TreeViewItem childitem in item.Items)
                {
                    tmpItem = GetParentItemFromChild1(childitem, parentType, parentID);
                    if (tmpItem != null)
                    {
                        break;
                    }
                }
            }
            return(tmpItem);
        }
Exemple #4
0
        /// <summary>
        /// 变更公司
        /// </summary>
        /// <param name="entity">公司实例</param>
        public void CompanyUpdate(T_HR_COMPANY entity)
        {
            try
            {
                var temp = dal.GetObjects().FirstOrDefault(s => (s.COMPANRYCODE == entity.COMPANRYCODE ||
                                                                 s.CNAME == entity.CNAME) && s.COMPANYID != entity.COMPANYID);
                if (temp != null)
                {
                    throw new Exception("Repetition");
                }
                var ents = from ent in dal.GetObjects()
                           where ent.COMPANYID == entity.COMPANYID
                           select ent;
                if (ents.Count() > 0)
                {
                    var ent = ents.FirstOrDefault();
                    Utility.CloneEntity <T_HR_COMPANY>(entity, ent);
                    //如果父公司为空,就不赋值
                    if (entity.T_HR_COMPANY2 != null)
                    {
                        ent.T_HR_COMPANY2Reference.EntityKey =
                            new System.Data.EntityKey(qualifiedEntitySetName + "T_HR_COMPANY", "COMPANYID", entity.T_HR_COMPANY2.COMPANYID);
                    }
                    //如果审核状态为审核通过则添加公司历史
                    if (entity.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString())
                    {
                        T_HR_COMPANYHISTORY companyHis = new T_HR_COMPANYHISTORY();
                        companyHis.RECORDSID = Guid.NewGuid().ToString();
                        //companyHis = Utility.CloneObject<T_HR_COMPANYHISTORY>(entity);
                        companyHis.COMPANYCATEGORY    = entity.COMPANYCATEGORY;
                        companyHis.COMPANRYCODE       = entity.COMPANRYCODE;
                        companyHis.COMPANYLEVEL       = entity.COMPANYLEVEL;
                        companyHis.COMPANYID          = entity.COMPANYID;
                        companyHis.CNAME              = entity.CNAME;
                        companyHis.ENAME              = entity.ENAME;
                        companyHis.T_HR_COMPANY       = entity.T_HR_COMPANY2;
                        companyHis.LEGALPERSON        = entity.LEGALPERSON;
                        companyHis.LINKMAN            = entity.LINKMAN;
                        companyHis.TELNUMBER          = entity.TELNUMBER;
                        companyHis.ADDRESS            = entity.ADDRESS;
                        companyHis.LEGALPERSONID      = entity.LEGALPERSONID;
                        companyHis.BUSSINESSLICENCENO = entity.BUSSINESSLICENCENO;
                        companyHis.BUSSINESSAREA      = entity.BUSSINESSAREA;
                        companyHis.ACCOUNTCODE        = entity.ACCOUNTCODE;
                        companyHis.BANKID             = entity.BANKID;
                        companyHis.EMAIL              = entity.EMAIL;
                        companyHis.ZIPCODE            = entity.ZIPCODE;
                        companyHis.FAXNUMBER          = entity.FAXNUMBER;
                        companyHis.CREATEDATE         = entity.CREATEDATE;
                        companyHis.CREATEUSERID       = entity.CREATEUSERID;
                        companyHis.UPDATEDATE         = DateTime.Now;
                        companyHis.UPDATEUSERID       = entity.UPDATEUSERID;
                        companyHis.REUSEDATE          = DateTime.Now;
                        companyHis.T_HR_COMPANYReference.EntityKey = null;
                        companyHis.T_HR_COMPANY = null;

                        companyHis.OWNERCOMPANYID    = entity.OWNERCOMPANYID;
                        companyHis.OWNERDEPARTMENTID = entity.OWNERDEPARTMENTID;
                        companyHis.OWNERID           = entity.OWNERDEPARTMENTID;
                        companyHis.OWNERPOSTID       = entity.OWNERPOSTID;

                        if (entity.EDITSTATE == Convert.ToInt32(EditStates.PendingCanceled).ToString())
                        {
                            companyHis.CANCELDATE = DateTime.Now;
                        }
                        //DataContext.AddObject("T_HR_COMPANYHISTORY", companyHis);
                        dal.AddToContext(companyHis);
                        GetCompanyForOutEngineXml(entity);//向引擎推送计算员工企业工龄的接口契约
                    }
                    dal.SaveContextChanges();
                    CacheManager.RemoveCache("T_HR_COMPANY");
                    //WorkflowUtility.CallWorkflow("公司审批审核工作流", ent);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
 public CompanyHistoryForm(T_HR_COMPANYHISTORY org)
 {
     InitializeComponent();
     Company        = org;
     this.IsEnabled = false;
 }
Exemple #6
0
 public void Audit()
 {
     T_HR_COMPANYHISTORY companyHis = new T_HR_COMPANYHISTORY();
     companyHis.RECORDSID = Guid.NewGuid().ToString();
     companyHis = Utility.CloneObject<T_HR_COMPANYHISTORY>(Company);
     //companyHis.COMPANYCATEGORY = Company.COMPANYCATEGORY;
     //companyHis.COMPANRYCODE = Company.COMPANRYCODE;
     //companyHis.COMPANYLEVEL = Company.COMPANYLEVEL;
     //companyHis.COMPANYID = Company.COMPANYID;
     //companyHis.CNAME = Company.CNAME;
     //companyHis.ENAME = Company.ENAME;
     //companyHis.T_HR_COMPANY = Company.T_HR_COMPANY2;
     //companyHis.LEGALPERSON = Company.LEGALPERSON;
     //companyHis.LINKMAN = Company.LINKMAN;
     //companyHis.TELNUMBER = Company.TELNUMBER;
     //companyHis.ADDRESS = Company.ADDRESS;
     //companyHis.LEGALPERSONID = Company.LEGALPERSONID;
     //companyHis.BUSSINESSLICENCENO = Company.BUSSINESSLICENCENO;
     //companyHis.BUSSINESSAREA = Company.BUSSINESSAREA;
     //companyHis.ACCOUNTCODE = Company.ACCOUNTCODE;
     //companyHis.BANKID = Company.BANKID;
     //companyHis.EMAIL = Company.EMAIL;
     //companyHis.ZIPCODE = Company.ZIPCODE;
     //companyHis.FAXNUMBER = Company.FAXNUMBER;
     if (Company.EDITSTATE == Convert.ToInt32(EditStates.PendingCanceled).ToString())
     {
         companyHis.CANCELDATE = DateTime.Now;
     }
     companyHis.REUSEDATE = DateTime.Now;
     //companyHis.CREATEDATE = Company.CREATEDATE;
     //companyHis.CREATEUSERID = Company.CREATEUSERID;
     //companyHis.UPDATEDATE = DateTime.Now;
     //companyHis.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
     client.CompanyHistoryAddAsync(companyHis);
 }
 public void CompanyHistoryAdd(T_HR_COMPANYHISTORY entity)
 {
     using (CompanyHistoryBLL bll = new CompanyHistoryBLL())
     {
         bll.CompanyHistoryAdd(entity);
     }
 }
Exemple #8
0
 public CompanyHistoryForm(T_HR_COMPANYHISTORY org)
 {
     InitializeComponent();
     Company = org;
     this.IsEnabled = false;
 }