Exemplo n.º 1
0
    protected override void PostStore()
    {
        if (this.IsModified())
        {
            LastGlobalModifier = DateTime.Now;
        }
        if (IsModifiedCol(_AsUser))
        {
            if (!string.IsNullOrEmpty(_reassignedFrom))
            {
                NotifyHub.NotifyPlanChange((new DefectUser(int.Parse(_reassignedFrom)).TRID));
            }

            //when task is reassigned order in new list should be changed.
            DefectBase d = new DefectBase(ID);
            if (d.ORDER != ORDER)
            {
                d.ORDER = ORDER;
                d.Store();
                return;
            }
        }

        if (!string.IsNullOrEmpty(AUSER))
        {
            NotifyHub.NotifyPlanChange((new DefectUser(int.Parse(AUSER)).TRID));
        }
        NotifyHub.NotifyDefectChange(ID);
    }
Exemplo n.º 2
0
    public int newTask4MeNow(string summary)
    {
        if (string.IsNullOrEmpty(summary))
        {
            return(-1);
        }
        DefectBase d = new DefectBase(Defect.New(summary));

        d.AUSER = CurrentContext.TTUSERID.ToString();
        d.ESTIM = 1;
        d.DISPO = DefectDispo.GetWorkingRec().ToString();
        d.ORDER = 1;
        d.Store();
        return(d.ID);
    }
Exemplo n.º 3
0
    public int newTask(string summary)
    {
        if (string.IsNullOrEmpty(summary))
        {
            return(-1);
        }
        DefectBase d = new DefectBase(Defect.New(summary));

        d.ESTIM = 1;
        List <int> disp = DefectDispo.EnumCanStartIDs();

        if (disp.Count > 0)
        {
            d.DISPO = disp[0].ToString();
        }
        d.Store();
        return(d.ID);
    }
Exemplo n.º 4
0
    public int planTask(string summary, int ttuserid)
    {
        if (string.IsNullOrEmpty(summary))
        {
            return(-1);
        }
        DefectBase d = new DefectBase(Defect.New(summary));

        d.AUSER = ttuserid == -1 ? CurrentContext.TTUSERID.ToString() : ttuserid.ToString();
        d.ESTIM = 1;
        List <int> disp = DefectDispo.EnumCannotStartIDs();

        if (disp.Count > 0)
        {
            d.DISPO = disp[0].ToString();
        }
        d.ORDER = 1;
        d.Store();
        return(d.ID);
    }
Exemplo n.º 5
0
    public void addVacation(string summary, int ttuserid, int num)
    {
        if (string.IsNullOrEmpty(summary) || ttuserid < 1 || num < 1 || num > 100)
        {
            return;
        }
        for (int i = 0; i < num; i++)
        {
            DefectBase d = new DefectBase(Defect.New(summary + " #" + (i + 1).ToString()));
            d.AUSER = ttuserid.ToString();
            d.ESTIM = 8;
            d.COMP  = DefectComp.GetVacationRec()[0].ToString();
            List <int> disp = DefectDispo.EnumCannotStartIDs();
            if (disp.Count > 0)
            {
                d.DISPO = disp[0].ToString();
            }
            d.DATE = new DateTime(DateTime.Now.Year, 12, 31).ToString(defDateFormat);
            d.Store();
        }
        MPSUser mpu = new MPSUser(new DefectUser(ttuserid).TRID);

        TasksBot.SendMessage(mpu.CHATID, $"{num} vacation tasks have been created for you by {CurrentContext.UserName()}");
    }