Exemple #1
0
        public TaskExchangeCompositeType getTaskExchangeByIdTaskIdExchangeTaskPre(TaskExchangeCompositeType tect)
        {
            TaskExchangeCompositeType etct = new TaskExchangeCompositeType();

            etct = te.GetTaskExchangeByIdTaskIdExchangeTaskPre(tect);
            return(etct);
        }
Exemple #2
0
    protected void btnTimmingEndUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            var tect = new TaskExchangeCompositeType();
            var tem  = new TaskExchangeManager();

            tect.iTask     = int.Parse(lblIdTaskT.Text.Trim());
            tect.iExchange = int.Parse(lblIdExchange.Text.Trim());
            tect           = tem.getTaskExchangeByIdTaskIdExchange(tect);
            int iTmDif = tect.iTiming - int.Parse(txtTimingEnd.Text.Trim());

            tect.iTiming      = int.Parse(txtTimingEnd.Text.Trim());
            tect.iTimingTotal = tect.iTimingTotal - iTmDif;
            tect.dTiming      = DateTime.Now.AddDays(tect.iTimingTotal * 7);

            tem.updateTaskSerie(tect, iTmDif, "imTimingFinal");
            gvTimming.DataBind();
            pnTimingEndUpdate.Visible = false;
        }
        catch (AccessViolationException ave)
        {
            Alert.Permisos(this.Page);
        }
    }
Exemple #3
0
    protected void imbSelectReviewExchange_Click1(object sender, ImageClickEventArgs e)
    {
        var tect = new TaskExchangeCompositeType();
        var tem  = new TaskExchangeManager();

        pnTimingEndUpdate.Visible = true;
        int iIdTask = int.Parse(((ImageButton)sender).CommandArgument.ToString());

        lblIdTaskT.Text = iIdTask.ToString();

        tect.iTask        = iIdTask;
        tect.iExchange    = int.Parse(lblIdExchange.Text);
        tect              = tem.getTaskExchangeByIdTaskIdExchange(tect);
        lblTaskNow.Text   = tect.sTask;
        txtTimingEnd.Text = tect.iTiming.ToString();
    }
Exemple #4
0
        public void UpdateTime_byGenerate(int iExchange, DateTime dAplicacion, string sDesencadenante)
        {
            var tareas = new TaskExchange();
            var dt     = tareas.GetTimming(iExchange);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                var tectA = new TaskExchangeCompositeType
                {
                    iExchange = iExchange,
                    iTask     = int.Parse(dt.Rows[i].ItemArray[3].ToString())
                };
                var tect = tareas.GetTaskExchangeByIdTaskIdExchange(tectA);
                tect.dTiming = dAplicacion.AddDays(tect.iTimingTotal * 7);
                UpdateTaskExchange(tect, sDesencadenante);
            }
        }
Exemple #5
0
        public errorCompositeType AddTaskExchange(TaskExchangeCompositeType tect)
        {
            var lstError = new errorCompositeType();

            try
            {
                te.InsertTaskExchange(tect);
                lstError.bError = true;
                lstError.sError = "";
                return(lstError);
            }
            catch (Exception ex)
            {
                lstError.bError = false;
                lstError.sError = ex.Message;
                return(lstError);
            }
        }
Exemple #6
0
    protected void btnAddTiming_Click(object sender, EventArgs e)
    {
        try
        {
            util.GetActionMenu(mpMenu.SelectedItem.Value);
            Util.isRequired(ddlTaskTiming.SelectedValue, "Tarea");
            Util.isRequired(txtTiming.Text.Trim(), "Timing");
            var te   = new TaskExchangeManager();
            var swap = new List <string>();
            var tect = new TaskExchangeCompositeType {
                iExchange = int.Parse(lblIdExchange.Text.Trim())
            };
            foreach (RadComboBoxItem item in ddlTaskTiming.Items)
            {
                var cb = (CheckBox)item.Controls[1];
                if (cb.Checked)
                {
                    swap.Add(item.Value);
                    tect.iTask = int.Parse(item.Value);
                    if (te.getCountTaskExchangeByIdTaskIdExchange(tect) > 0)
                    {
                        throw new ArgumentException("La tarea " + item.Text + " ya ha sido cargada");
                    }
                }
            }
            te.InsertBulkTaskExchange(int.Parse(txtTiming.Text), swap, int.Parse(lblIdExchange.Text.Trim()), DateTime.Now.AddDays(int.Parse(txtTiming.Text) * 7), int.Parse(ddlGroup.SelectedValue));

            util.ErroDisplay(5, string.Empty, ref lblMessage);
            lblMessage.Focus();
            Response.Redirect("Timming.aspx?ex=" + Request.QueryString["ex"] + "&mod=" + Request.QueryString["mod"]);
        }
        catch (AccessViolationException ave)
        {
            Alert.Permisos(this.Page);
        }
        catch (ArgumentException ae)
        {
            util.ErroDisplay(3, ae.Message, ref lblMessage);
        }
        catch (Exception ex)
        {
            util.ErroDisplay(1, string.Empty, ref lblMessage);
        }
    }
Exemple #7
0
        //

        //public List<TaskExchangeCompositeType> getAllTaskExchange()
        //{
        //    List<TaskExchangeCompositeType> lst = new List<TaskExchangeCompositeType>();
        //    TaskExchange et = new TaskExchange();
        //    lst = et.getAll();
        //    return lst;
        //}

        //public TaskExchangeCompositeType getTaskExchangeById(int iIdTaskExchange)
        //{
        //    TaskExchangeCompositeType etct = new TaskExchangeCompositeType();
        //    TaskExchange et = new TaskExchange();
        //    etct = et.GetTaskExchangeById(iIdTaskExchange);
        //    return etct;
        //}

        public errorCompositeType UpdateTaskExchange(TaskExchangeCompositeType tect, string sDesencadenante)
        {
            var lstError = new errorCompositeType();

            try
            {
                var et = new TaskExchange();
                et.UpdateTaskExchange(tect, sDesencadenante);

                lstError.bError = true;
                lstError.sError = "";
                return(lstError);
            }
            catch (Exception ex)
            {
                lstError.bError = false;
                lstError.sError = ex.Message;
                return(lstError);
            }
        }
Exemple #8
0
        public errorCompositeType updateTaskSerie(TaskExchangeCompositeType tect, int iDiference, string sDesencadenante)
        {
            var lstError = new errorCompositeType();

            try
            {
                var te    = new TaskExchange();
                var tect2 = new TaskExchangeCompositeType();
                UpdateTaskExchange(tect, sDesencadenante);
                int iTaskExchangePre = tect.iNextTask;
                tect2.iExchange = tect.iExchange;
                tect2.iNextTask = tect.iTask;
                while (getCountTaskExchangeByIdTaskIdExchangeTaskPre(tect2) > 0)
                {
                    tect2 = getTaskExchangeByIdTaskIdExchangeTaskPre(tect2);
                    tect2.iTimingTotal = tect2.iTimingTotal - iDiference;
                    UpdateTaskExchange(tect2, sDesencadenante);
                    tect2.iNextTask = tect2.iTask;
                    if (getCountTaskExchangeByIdTaskIdExchangeTaskPre(tect2) > 0)
                    {
                        tect2 = getTaskExchangeByIdTaskIdExchangeTaskPre(tect2);
                    }
                    else
                    {
                        tect2.iNextTask = 0;
                        tect2.iExchange = 0;
                    }
                }
                lstError.bError = true;
                lstError.sError = "";
                return(lstError);
            }
            catch (Exception ex)
            {
                lstError.bError = false;
                lstError.sError = ex.Message;
                return(lstError);
            }
        }
Exemple #9
0
 protected void btnEditTimmingSave_Click(object sender, EventArgs e)
 {
     try
     {
         bool flag = true;
         util.GetActionMenu(mpMenu.SelectedItem.Value);
         Util.isRequired(ddlTaskTiming_Edit.SelectedValue, "Tarea");
         Util.isRequired(txtTiming_Edit.Text.Trim(), "Timing");
         if (chlTaskNext.Checked)
         {
             Util.isRequired(ddlNestTask.SelectedValue.ToString(), "Tarea predecesora, si esta marcado,");
         }
         Util.isRequired(ddlUsuarioTask_Edit.SelectedValue.ToString(), "Usuario");
         var te   = new TaskExchangeManager();
         var tect = new TaskExchangeCompositeType
         {
             iEmployed = int.Parse(ddlUsuarioTask_Edit.SelectedValue.ToString()),
             iExchange = int.Parse(lblIdExchange.Text.Trim()),
             iTask     = int.Parse(ddlTaskTiming_Edit.SelectedValue.ToString()),
             iTiming   = int.Parse(txtTiming_Edit.Text.Trim())
         };
         if (chlTaskNext.Checked)
         {
             var tectPre = new TaskExchangeCompositeType
             {
                 iTask     = int.Parse(ddlNestTask.SelectedValue),
                 iExchange = tect.iExchange
             };
             if (te.getCountTaskExchangeByIdTaskIdExchange(tectPre) > 0)
             {
                 tect.iNextTask    = int.Parse(ddlNestTask.SelectedValue);
                 tect.iTimingTotal = int.Parse(te.getTaskExchangeByIdTaskIdExchange(tectPre).iTimingTotal.ToString()) + tect.iTiming;
             }
             else
             {
                 throw new ArgumentException("La tarea predecesora: " + ddlNestTask.SelectedItem.Text + " no ha sido cargada");
             }
         }
         else
         {
             tect.iNextTask    = 0;
             tect.iTimingTotal = tect.iTiming;
         }
         tect.dTiming = DateTime.Now.AddDays(tect.iTimingTotal * 7);
         tect.iGroup  = int.Parse(ddlGroup.SelectedValue);
         var btn = (RadButton)sender;
         if (btn.CommandArgument == "0")
         {
             if (te.getCountTaskExchangeByIdTaskIdExchange(tect) > 0)
             {
                 throw new ArgumentException("La tarea " + ddlTaskTiming_Edit.SelectedItem.Text + " ya ha sido cargada");
             }
             te.AddTaskExchange(tect);
         }
         else
         {
             tect.iIdTaskExchange = int.Parse(btnEditTimmingSave.CommandArgument);
             te.UpdateTaskExchange(tect, ((RadButton)sender).ID);
         }
         //TaskExchange();
         util.ErroDisplay(5, string.Empty, ref lblMessage);
         lblMessage.Focus();
         btnEditTimmingSave.CommandArgument = "0";
         Response.Redirect("Timming.aspx?ex=" + Request.QueryString["ex"] + "&mod=" + Request.QueryString["mod"], false);
     }
     catch (AccessViolationException ave)
     {
         Alert.Permisos(this.Page);
     }
     catch (ArgumentException ae)
     {
         util.ErroDisplay(3, ae.Message, ref lblMessage);
     }
     catch (Exception ex)
     {
         util.ErroDisplay(1, string.Empty, ref lblMessage);
     }
 }
Exemple #10
0
        public int getCountTaskExchangeByIdTaskIdExchangeTaskPre(TaskExchangeCompositeType tect)
        {
            int a = te.GetCountTaskExchangeByIdTaskIdExchangeTaskPre(tect);

            return(a);
        }