Exemplo n.º 1
0
        /// <summary>
        /// 编辑员工目标
        /// </summary>
        public bool EditResQuota(sys_resource_sales_quota quota, long userId)
        {
            sys_resource_sales_quota_dal srsqDal  = new sys_resource_sales_quota_dal();
            sys_resource_sales_quota     oldQuota = GetQuotaById(quota.id);

            if (oldQuota == null)
            {
                return(false);
            }
            quota.update_time    = Tools.Date.DateHelper.ToUniversalTimeStamp();
            quota.update_user_id = userId;
            srsqDal.Update(quota);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增员工目标
        /// </summary>
        public bool AddResQuota(sys_resource_sales_quota quota, long userId)
        {
            sys_resource_sales_quota_dal srsqDal    = new sys_resource_sales_quota_dal();
            sys_resource_sales_quota     checkQuota = GetResMonthQuota(quota.resource_id, quota.year, quota.month);

            if (checkQuota != null)
            {
                return(false);
            }
            quota.id             = srsqDal.GetNextIdCom();
            quota.create_time    = quota.update_time = Tools.Date.DateHelper.ToUniversalTimeStamp();
            quota.create_user_id = quota.update_user_id = userId;
            srsqDal.Insert(quota);
            return(true);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["year"]))
            {
                int.TryParse(Request.QueryString["year"], out year);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["month"]))
            {
                int.TryParse(Request.QueryString["month"], out month);
            }
            resourceList = new UserResourceBLL().GetResourceByTime(year, month);
            long resId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["resId"]) && long.TryParse(Request.QueryString["resId"], out resId))
            {
                resQuota = salBll.GetResMonthQuota(resId, year, month);
            }
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                resQuota = salBll.GetQuotaById(id);
            }

            if (resQuota != null)
            {
                isAdd = false;
                var thisRes = new UserResourceBLL().GetResourceById(resQuota.resource_id);
                year  = resQuota.year;
                month = resQuota.month;
                if (resourceList == null || (!resourceList.Any(_ => _.id == resQuota.resource_id)))
                {
                    resourceList.Add(thisRes);
                }
            }
        }