Example #1
0
 public void GetRutaActasTest()
 {
     GCRegActasBL target = new GCRegActasBL(); // TODO: Initialize to an appropriate value
     string cod_con = string.Empty; // TODO: Initialize to an appropriate value
     IList<ESTADOS> expected = null; // TODO: Initialize to an appropriate value
     IList<ESTADOS> actual;
     actual = target.GetRutaActas(cod_con);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public static List<CCombo> GetRutaEst(string cod_con)
 {
     List<CCombo> Est=null;
     if (!String.IsNullOrEmpty(cod_con))
     {
         GCRegActasBL gcRa = new GCRegActasBL();
         Est = gcRa.GetRutaActas(cod_con).Select(t => new CCombo() { Codigo = t.COD_EST, Descripcion = t.NOM_EST }).ToList();
     }
     return Est;
 }
 public static ByARpt guardarActa(RegActas regActas)
 {
     ESTCONTRATOS ec = new ESTCONTRATOS();
     ec.COD_CON = regActas.CodCon;
     ec.EST_FIN = regActas.EstFin;
     ec.FEC_ENT = Convert.ToDateTime(regActas.Fecha);
     ec.OBS_EST = regActas.Observacion;
     ec.VAL_PAGO = regActas.ValAut;
     ec.NVISITAS = regActas.NVisitas;
     ec.POR_EJE_FIS = regActas.Avance;
     ec.ID = regActas.Id;
     ec.USUARIO = "boris";
     GCRegActasBL gcRa = new GCRegActasBL();
     return regActas.Id == 0 ? gcRa.Insert(ec) : gcRa.Update(ec);
 }
 public static IList<vEstContratos> getActas(string cod_con)
 {
     GCRegActasBL gcRa = new GCRegActasBL();
     IList<vEstContratos> lst = gcRa.GetActas(cod_con);
     return lst;
 }
 public static ByARpt anularActas(int Ide_Acta)
 {
     GCRegActasBL gcRa = new GCRegActasBL();
     return gcRa.Anular(Ide_Acta);
 }
        public void ProcessRequest(HttpContext context)
        {
            JavaScriptSerializer ser = new JavaScriptSerializer();//Retorno

            int iDisplayLength = Convert.ToInt32(HttpContext.Current.Request["iDisplayLength"]);
            string codcon = HttpContext.Current.Request["codcon"];
            int iDisplayStart = Convert.ToInt32(HttpContext.Current.Request["iDisplayStart"]);
            int iEcho = Convert.ToInt32(HttpContext.Current.Request["sEcho"]);
            int iSortingCols = Convert.ToInt32(HttpContext.Current.Request["iSortingCols"]);
            int iSortCol = Convert.ToInt32(HttpContext.Current.Request["iSortCol_0"]);
            int iColumns = Convert.ToInt32(HttpContext.Current.Request["iColumns"]);
            string searchString = HttpContext.Current.Request["sSearch"];
            string sSortDir = HttpContext.Current.Request["sSortDir_0"];
            GCRegActasBL gcRa = new GCRegActasBL();
            IEnumerable<vEstContratos> lst = gcRa.GetActas(codcon);
            //Datos Totales de la Consulta
            var list = new FormatedList();
            list.sEcho = iEcho;
            list.iTotalRecords = lst.Count();
            if(iDisplayLength>-1)
                lst = lst.Skip(iDisplayStart).Take(iDisplayLength);
            if (!String.IsNullOrEmpty(searchString))
            {
                //Se puede escoger las colomnas
                lst=lst.Where(p => p.NOM_EST.Contains(searchString));
            }

            // iSortCol_0  //    0=cust Ac     1=cust name    2=rep
            // iSortDir_0  // asc or desc...
            if (iSortingCols == 1)
            {
                if (sSortDir == "asc" && iSortCol == 0) { lst = lst.OrderBy(p => p.ID); }
                if (sSortDir == "desc" && iSortCol == 0) { lst = lst.OrderByDescending(p => p.ID); }

                if (sSortDir == "asc" && iSortCol == 1) { lst = lst.OrderBy(p => p.NRO_DOC); }
                if (sSortDir == "desc" && iSortCol == 1) { lst = lst.OrderByDescending(p => p.NRO_DOC); }

                if (sSortDir == "asc" && iSortCol == 2) { lst = lst.OrderBy(p => p.sFEC_ENT); }
                if (sSortDir == "desc" && iSortCol == 2) { lst = lst.OrderByDescending(p => p.sFEC_ENT); }
            }

            //string cod_con)
            List<List<string>> lightList = new List<List<string>>();
            int index=0;
            foreach (vEstContratos obj in lst)
            {
                var item = new List<string>();
                item.Add(obj.ID.ToString());
                item.Add(obj.NOM_EST.ToString());
                item.Add(obj.NRO_DOC.ToString());
                item.Add(obj.sFEC_ENT.ToString());
                item.Add(obj.NVISITAS.ToString());
                item.Add(obj.POR_EJE_FIS.ToString());
                item.Add(obj.VAL_PAGO.ToString());
                var Editar = "<input id='Editar' class='button_editar' type='button' />";
                item.Add(Editar);
                var Anular = (index == lst.Count() - 1) ? "<input id='Anular' class='button_anular' type='button' />" : "";
                index = index + 1;
                item.Add(Anular);

                lightList.Add(item);

            }
            list.iTotalDisplayRecords = lst.Count();
            list.aaData = lightList;

            var json = Newtonsoft.Json.JsonConvert.SerializeObject(list);

            //context.Response.ContentType = "text/plain";
            context.Response.ContentType = ("text/html");
            context.Response.BufferOutput = true;
            //ser.Serialize(
            context.Response.Write(json);
            context.Response.End();
        }