Beispiel #1
0
        private bool CheckBudget(Guid ProjectCode, string TaskCode, string TaskBookCode, string ResourceCode, decimal Quantity, int ResourceStyle, out string Msg)
        {
            Msg = "";
            string[]   strArray  = (string[])HttpContext.Current.Session["AlertTypes"];
            string     alertCode = strArray[ResourceStyle - 1];
            AlertPoint point     = new AlertPoint(alertCode);

            new SchedulePlanAction();
            ResourceItemAction action          = new ResourceItemAction();
            AlertMessage       message         = new AlertMessage();
            UserInfo           currentUserInfo = userManageDb.GetCurrentUserInfo();

            if (currentUserInfo != null)
            {
                message.ManInput = currentUserInfo.UserCode;
            }
            message.MenAlertTo     = point.YHDMsOfPeopleAlertTo;
            message.TimeInput      = DateTime.Now;
            message.TimeOutput     = DateTime.Now;
            message.TimeOver       = DateTime.Now.AddDays(point.ValidTimeLong);
            message.PresentimentID = point.pkID;
            if (!point.Options[2].IsSelected)
            {
                string  format = "select dbo.Prj_f_CompareBugdet('{0}','{1}','{2}','{3}',{4})";
                decimal num    = decimal.Parse(publicDbOpClass.ExecuteScalar(string.Format(format, new object[] { ProjectCode, TaskCode, TaskBookCode, ResourceCode, Quantity })).ToString());
                if (num >= 0M)
                {
                    return(true);
                }
                if (point.Options[0].IsSelected)
                {
                    Msg = action.GetResourceItem(ResourceCode).ResourceName + "超出预算指标:" + Math.Abs(num).ToString();
                    return(false);
                }
            }
            return(true);
        }
Beispiel #2
0
 public CostAlertAction(string AlertCode)
 {
     this.AlertID = AlertCode;
     this._ObjAp  = new AlertPoint(AlertCode);
 }