コード例 #1
0
        public override void ChartConfigCondition(Sungero.Domain.Client.ExecuteChildCollectionActionArgs e)
        {
            IContractCondition condition;

            if (_obj.Condition == null)
            {
                condition = Functions.ContractCondition.Remote.CreateContractCondition();
            }
            else
            {
                condition = _obj.Condition;
            }

            Docflow.PublicFunctions.ApprovalRuleBase.AddDocumentKindToCondition(_obj.ApprovalRuleBase, condition);

            condition.ShowModal();

            // TODO Belyak: баг платформы 32055. Убрать переполучение условия после исправления.
            if (!condition.State.IsInserted)
            {
                condition = ContractConditions.As(Docflow.PublicFunctions.ConditionBase.Remote.GetCondition(condition.Id));
            }

            if (!condition.State.IsInserted && !Equals(_obj.Condition, condition))
            {
                _obj.Condition = condition;
            }
        }
コード例 #2
0
        public override void Created(Sungero.Domain.CreatedEventArgs e)
        {
            base.Created(e);
            _obj.DocumentFlow = Docflow.ApprovalRuleBase.DocumentFlow.Contracts;

            if (_obj.State.IsCopied)
            {
                foreach (var conditionsList in _obj.Conditions)
                {
                    var newCondition = ContractConditions.Copy(ContractConditions.As(conditionsList.Condition));
                    newCondition.Save();
                    conditionsList.Condition = newCondition;
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Создать правила по умолчанию.
        /// </summary>
        public static void CreateDefaultContractualRules()
        {
            InitializationLogger.Debug("Init: Create default contractual approval rules.");

            var stages = new List <Enumeration>
            {
                StageType.Manager, StageType.Approvers, StageType.Print, StageType.Sign, StageType.Register, StageType.Sending, StageType.CheckReturn, StageType.Notice
            };

            var rule = CreateDefaultRule(Resources.DefaultApprovalRuleNameContracts,
                                         Docflow.ApprovalRuleBase.DocumentFlow.Contracts,
                                         stages);

            // Добавить условие по способу отправки и непосредственный руководитель - подписывающий, для созданного правила.
            if (rule != null)
            {
                var deliveryCondition = ContractConditions.Create();
                deliveryCondition.ConditionType = Docflow.ConditionBase.ConditionType.DeliveryMethod;
                var newDeliveryMethod = deliveryCondition.DeliveryMethods.AddNew();
                newDeliveryMethod.DeliveryMethod = Docflow.MailDeliveryMethods.GetAll(m => m.Sid == Docflow.Constants.MailDeliveryMethod.Exchange).FirstOrDefault();
                deliveryCondition.Save();
                var printStageNumber = stages.IndexOf(StageType.Print) + 1;
                Docflow.PublicInitializationFunctions.Module.AddConditionToRule(rule, deliveryCondition, printStageNumber);

                var rolesCompareCondition = Docflow.PublicInitializationFunctions.Module.CreateRoleCompareSignatoryAndInitManagerCondition(ContractConditions.Create());
                var managerStageNumber    = stages.IndexOf(StageType.Manager) + 1;
                Docflow.PublicInitializationFunctions.Module.AddConditionToRule(rule, rolesCompareCondition, managerStageNumber);
            }

            InitializationLogger.Debug("Init: Create default invoice approval rules.");
            var invoiceStages = new List <Enumeration>
            {
                StageType.Manager, StageType.Approvers, StageType.Sign
            };
            var invoiceRule = CreateDefaultInvoiceRule(Resources.DefaultApprovalRuleNameInvoice, invoiceStages);

            if (invoiceRule != null)
            {
                var rolesCompareCondition = Docflow.PublicInitializationFunctions.Module.CreateRoleCompareSignatoryAndInitManagerCondition(Conditions.Create());
                var managerStageNumber    = invoiceStages.IndexOf(StageType.Manager) + 1;
                Docflow.PublicInitializationFunctions.Module.AddConditionToRule(invoiceRule, rolesCompareCondition, managerStageNumber);
            }
        }
コード例 #4
0
        /// <summary>
        /// 筛选员工合同
        /// </summary>
        /// <param name="model">筛选model</param>
        /// <returns></returns>
        public List <ContractInfo> FindConstractInfo(ContractConditions model)
        {
            List <ContractInfo> list = new List <ContractInfo>();
            DataTable           dt   = contractDal.FindConstractInfo(model);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ContractInfo result = new ContractInfo();
                    result.rn             = dt.Rows[i][0].ToString();
                    result.EMPLOYEEID     = dt.Rows[i][1].ToString();
                    result.employeeName   = dt.Rows[i][2].ToString();
                    result.sex            = dt.Rows[i][3].ToString();
                    result.age            = dt.Rows[i][4].ToString();
                    result.idnumber       = dt.Rows[i][5].ToString();
                    result.CONTRACTTYPE   = dt.Rows[i][6].ToString();
                    result.OPERATETYPE    = dt.Rows[i][7].ToString();
                    result.CONTRACTSTATUS = dt.Rows[i][8].ToString();
                    result.BEGINTIME      = dt.Rows[i][9].ToString();
                    result.ENDTIME        = dt.Rows[i][10].ToString();
                    result.DEADLINE       = dt.Rows[i][11].ToString();
                    result.tryTime        = dt.Rows[i][12].ToString();
                    result.JOINPOST       = dt.Rows[i][13].ToString();
                    result.WORKINGPLACE   = dt.Rows[i][14].ToString();
                    result.TRIALSALARY    = dt.Rows[i][15].ToString();
                    result.OFFICIALSALARY = dt.Rows[i][16].ToString();
                    result.REMARK         = dt.Rows[i][17].ToString();
                    result.CUSTOMERID     = dt.Rows[i][18].ToString();
                    result.CONTRACTID     = dt.Rows[i][19].ToString();
                    result.CONTRACTCODE   = dt.Rows[i][20].ToString();
                    list.Add(result);
                }
            }

            return(list);
        }
コード例 #5
0
 public IHttpActionResult FindConstractInfo(ContractConditions model)
 {
     return(Json(contractBll.FindConstractInfo(model)));
 }
コード例 #6
0
ファイル: ContractDal.cs プロジェクト: yangyulin007/OAth
        /// <summary>
        /// 筛选员工
        /// </summary>
        /// <param name="model">刷选model</param>
        /// <returns></returns>
        public DataTable FindConstractInfo(ContractConditions model)
        {
            string customerid  = model.customerid;
            string customerids = FairhrForeign.Others.Function.GetParentCustomerID(ref customerid);
            int    pageSize    = int.Parse(ConfigurationManager.AppSettings["pageSize"].ToString());
            string sql         =
                @"select *
  from (select row_number() over(order by a.ADDTIME desc) rn,
               b.employeeid,
               b.REALNAME,
               b.SEX,
               b.age,
               b.idnumber,
               decode(a.CONTRACTTYPE,
                      '1',
                      '劳动合同',
                      '2',
                      '劳务合同',
                      '3',
                      '返聘协议',
                      '4',
                      '实习协议') contractType,
               decode(a.OPERATETYPE, '1', '新签', '续签') AS OPERATETYPE,
               decode(a.CONTRACTSTATUS, '1', '有效', '无效') AS CONTRACTSTATUS,
               TO_CHAR(nvl(a.begintime, a.signedtime), 'YYYY-MM-DD') as begintime,
               TO_CHAR(a.ENDTIME, 'YYYY-MM-DD') AS ENDTIME,
               a.DEADLINE as DEADLINE,
               ceil(months_between(a.trialendtime, a.trialstarttime)) tryTime,
               a.joinpost,
               a.workingplace,
               a.TRIALSALARY,
               a.OFFICIALSALARY,
               a.REMARK,
               d.customerid,
               a.contractid,
                a.contractcode
          FROM EM_CONTRACT a
          LEFT JOIN EM_EMPLOYEE b ON b.EMPLOYEEID = a.EMPLOYEEID
          LEFT JOIN em_employeecompany c on c.EMPLOYEEID = a.EMPLOYEEID
          LEFT JOIN cu_customer d on d.CUSTOMERID = c.CUSTOMERID
         where a.isdelete = 0
           AND d.CUSTOMERID in (" + customerids + ")";

            if (!string.IsNullOrEmpty(model.contractState))
            {
                sql += "and a.CONTRACTSTATUS='" + model.contractState + "'";
            }

            if (!string.IsNullOrEmpty(model.employeeType))
            {
                sql += " and b.ISLEVEL='" + model.employeeType + "'";
            }

            if (!string.IsNullOrEmpty(model.opreateType))
            {
                sql += "and a.OPERATETYPE='" + model.opreateType + "'";
            }

            if (!string.IsNullOrEmpty(model.constractStartTime_start))
            {
                sql += "and  nvl(a.begintime,a.signedtime)>= to_date('" + model.constractStartTime_start + "','yyyy-MM-dd')";
            }

            if (!string.IsNullOrEmpty(model.constractStartTime_end))
            {
                sql += "and   nvl(a.begintime,a.signedtime)<=to_date('" + model.constractStartTime_end + "','yyyy-MM-dd')";
            }

            if (!string.IsNullOrEmpty(model.constractEndTime_start))
            {
                sql += "and   a.ENDTIME >=to_date('" + model.constractEndTime_start + "','yyyy-MM-dd')";
            }

            if (!string.IsNullOrEmpty(model.constractEndTime_end))
            {
                sql += "and   a.endtime <=to_date('" + model.constractEndTime_end + "','yyyy-MM-dd')";
            }

            sql += ")t where t.rn between (" + model.current + " -1) * " + pageSize + " and " + model.current + " *" + pageSize;

            return(FairHR.Common.DbHelperOra.Query(sql).Tables[0]);
        }
コード例 #7
0
 public static IContractCondition CreateContractCondition()
 {
     return(ContractConditions.Create());
 }