Exemplo n.º 1
0
 public bool AddCodeRule(d_cost_code_rule code, long userId)
 {
     code.id             = _dal.GetNextIdCom();
     code.create_time    = code.update_time = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
     code.create_user_id = code.update_user_id = userId;
     new d_cost_code_rule_dal().Insert(code);
     // OperLogBLL.OperLogAdd<d_cost_code>(code, code.id, userId, OPER_LOG_OBJ_CATE.D_COST_CODE, "");
     return(true);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 编辑物料代码
        /// </summary>
        public bool EditCodeRule(d_cost_code_rule code, long userId)
        {
            d_cost_code_rule oldCode = GetCodeRuleById(code.id);

            if (oldCode == null)
            {
                return(false);
            }

            code.update_time    = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
            code.update_user_id = userId;
            new d_cost_code_rule_dal().Update(code);
            // OperLogBLL.OperLogUpdate<d_cost_code>(code, oldCode, code.id, userId, OPER_LOG_OBJ_CATE.D_COST_CODE, "");
            return(true);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                codeRule = codeBll.GetCodeRuleById(id);
            }
            long codeId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["codeId"]) && long.TryParse(Request.QueryString["codeId"], out codeId))
            {
                code = codeBll.GetCodeById(codeId);
            }
            if (codeRule != null)
            {
                isAdd = false;
                code  = codeBll.GetCodeById(codeRule.cost_code_id);
            }
            if (code == null)
            {
                Response.Write("<script>alert('未获取到物料代码信息!');window.close();</script>");
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var exp_id = Request.QueryString["exp_id"];
                if (!string.IsNullOrEmpty(exp_id))
                {
                    thisExpense = new sdk_expense_dal().FindNoDeleteById(long.Parse(exp_id));
                    if (thisExpense != null)
                    {
                        thisAccount = new CompanyBLL().GetCompany(thisExpense.account_id);
                    }

                    long?accout_id = null;
                    if (thisAccount != null)
                    {
                        accout_id = thisAccount.id;
                    }
                    if (thisExpense.expense_cost_code_id != null)
                    {
                        var ruleList = new d_cost_code_rule_dal().GetRuleByCodeId((long)thisExpense.expense_cost_code_id);
                        if (ruleList != null && ruleList.Count > 0)
                        {
                            thisRule = new TaskBLL().GetRule(ruleList, accout_id);
                        }
                    }
                }
                var account_id = Request.QueryString["account_id"];
                if (!string.IsNullOrEmpty(account_id))
                {
                    thisAccount = new CompanyBLL().GetCompany(long.Parse(account_id));
                }

                // 费用的cate 种类 在d_cost_code上,
                // 相关规则在d_cost_code_rule上
                // 放个iframe 使用通用查询

                if (thisAccount == null)
                {
                    Response.End();
                }
                else
                {
                    var url    = "../Common/SearchBodyFrame?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.ACCOUNT_POLICY + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.ACCOUNT_POLICY + "&con1057=" + thisAccount.id + "&con1056=" + LoginUserId;
                    var deaDep = new sys_resource_department_dal().GetDepByRes(LoginUserId);  // 员工的默认部门
                    if (deaDep != null)
                    {
                        url += "&con1058=" + deaDep.id;
                    }
                    var cate_id = Request.QueryString["cate_id"];
                    if (!string.IsNullOrEmpty(cate_id))
                    {
                    }
                    AccountPolicy.Src = url;
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }