Esempio n. 1
0
 public void copyTasks(string ttids)
 {
     string[] ids = ttids.Split(',');
     foreach (string id in ids)
     {
         Defect old = new Defect(int.Parse(id));
         Defect d   = new Defect(Defect.New(old.SUMMARY));
         d.From(old);
         d.DISPO = old.DISPO;
         d.Store();
     }
 }
Esempio n. 2
0
    public int copyTask(int ttid)
    {
        Defect old = new Defect(ttid);
        Defect d   = new Defect(Defect.New(old.SUMMARY));

        d.From(old);
        d.AUSER = "";
        d.ESTIM = 0;
        d.ORDER = -1;
        d.Store();
        return(d.ID);
    }
Esempio n. 3
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);
    }
Esempio n. 4
0
    public DefectPlan newTask(string summary, int trackerid)
    {
        CurrentContext.ValidateAdmin();
        if (string.IsNullOrEmpty(summary) || trackerid < 0)
        {
            return(null);
        }
        Tracker t = new Tracker(trackerid);

        summary += "@" + t.NAME;
        Defect d = new Defect(Defect.New(summary));

        d.AddMessage("tag:" + t.GetTag(), CurrentContext.UserID);
        d.ESTIM = 1;
        d.Store();
        return(new DefectPlan(d));
    }
Esempio n. 5
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);
    }
Esempio n. 6
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);
    }
Esempio n. 7
0
    public void addSickness(string details, int ttuserid)
    {
        if (!CurrentContext.Valid)
        {
            return;
        }

        if (string.IsNullOrEmpty(details) || ttuserid < 1)
        {
            return;
        }
        DateTime dt = DateTime.Today;
        Defect   d  = new Defect(Defect.New("SICKNESS DAY " + dt.Year));

        d.DESCR = $"{CurrentContext.User.PERSON_NAME}: {details}";
        d.AUSER = ttuserid.ToString();
        d.DISPO = DefectDispo.GetWorkingRec().ToString();
        d.ESTIM = 8;
        d.COMP  = DefectComp.GetVacationRec()[0].ToString();
        d.DATE  = dt.ToString(defDateFormat);
        d.Store();
        TasksBot.SendMessage(Settings.CurrentSettings.TELEGRAMCOMPANYCHANNEL, $"🌡{details}");
    }
Esempio n. 8
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()}");
    }