コード例 #1
0
        public ActionResult Add(/*string AttribCode,*/ string AttribName, string varCode, string varName, string Creator)
        {
            var attributeContext = new DBModelEntities();
            IList <AttributeVariable> attributeVars = attributeContext.AttributeVariables.ToList();
            IList <Models.Attribute>  attributeList = attributeContext.Attributes.ToList();

            //AttributesVariablesViewModel.AttributesVariablesList.Add(new AttributesVariablesViewModel { AttributeCode = AttribCode, AttributeName = AttribName, VariableCode = varCode, VariableName = varName, DateSet = DateTime.Today, CreatedBy = Creator });
            //AttributeVariable.AttributesVariablesList.Add(new AttributeVariable { ACode = Convert.ToInt32(AttribCode), Name = varName, CreatedOn = DateTime.Today, CreatedBy = Creator });

            foreach (var attribute in attributeList)
            {
                if (attribute.Name == AttribName)
                {
                    string            AttribCode      = attribute.Code.ToString();
                    AttributeVariable addAttributeVar = new AttributeVariable();
                    addAttributeVar.ACode     = Convert.ToInt32(AttribCode);
                    addAttributeVar.Name      = varName;
                    addAttributeVar.CreatedOn = DateTime.Today;
                    addAttributeVar.CreatedBy = Creator;
                    db.AttributeVariables.Add(addAttributeVar);
                    db.SaveChanges();
                }
                else
                {
                    continue;
                }
            }

            return(Json(new
            {
                //aaData = AttributesVariablesViewModel.AttributesVariablesList.Select(x => new[] { x.AttributeCode, x.AttributeName, x.VariableCode, x.VariableName, x.DateSet.ToString(), x.CreatedBy })
                aaData = attributeVars.Select(x => new[] { x.Attribute.Code.ToString(), x.Attribute.Name, x.Code.ToString(), x.Name, x.CreatedOn.ToString(), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult Add(string EleID, string EleName, string Creator)
        {
            var             elementContext = new DBModelEntities();
            IList <Element> elements       = elementContext.Elements.ToList();

            //ElementsViewModel.ElementsList.Add(new ElementsViewModel { ElementId = EleID, ElementName = EleName, DateSet = DateTime.Today, CreatedBy = Creator });
            elements.Add(new Element {
                Code = Convert.ToInt32(EleID), Name = EleName, CreatedOn = DateTime.Today, CreatedBy = Creator
            });

            Element addElement = new Element();

            addElement.Code      = Convert.ToInt32(EleID);
            addElement.OrgID     = 2;
            addElement.Name      = EleName;
            addElement.CreatedOn = DateTime.Today;
            addElement.CreatedBy = Creator;
            db.Elements.Add(addElement);
            db.SaveChanges();

            return(Json(new
            {
                //aaData = ElementsViewModel.ElementsList.Select(x => new[] { x.ElementId, x.ElementName, x.DateSet.ToString(), x.CreatedBy })
                aaData = elements.Select(x => new[] { x.Code.ToString(), x.Name, x.CreatedOn.ToString(), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
 public bool removeRegistro(int registro)
 {
     try
     {
         using (var trx = new TransactionScope())
         {
             using (var db = new DBModelEntities())
             {
                 db.Database.CommandTimeout          = 200000;
                 db.Configuration.LazyLoadingEnabled = false;
                 var validCreado     = Convert.ToInt16(BusinessEnumerations.EstatusCarga.CREADO);
                 var validPorAprobar = Convert.ToInt16(BusinessEnumerations.EstatusCarga.POR_APROBAR);
                 EFBatchOperation.For(db, db.SAX_PARTIDAS).Where(p => p.RC_REGISTRO_CONTROL == registro && (p.PA_STATUS_PARTIDA == validCreado ||
                                                                                                            p.PA_STATUS_PARTIDA == validPorAprobar)).Delete();
                 EFBatchOperation.For(db, db.SAX_REGISTRO_CONTROL).Where(p => p.RC_REGISTRO_CONTROL == registro).Delete();
             }
             trx.Complete();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(true);
 }
コード例 #4
0
        public SAX_REGISTRO_CONTROL LoadFileData(SAX_REGISTRO_CONTROL control)
        {
            SAX_REGISTRO_CONTROL registro = null;

            try
            {
                using (var trx = new TransactionScope())
                {
                    using (var db = new DBModelEntities())
                    {
                        db.Database.CommandTimeout          = 200000;
                        db.Configuration.LazyLoadingEnabled = false;
                        var partidas = control.SAX_PARTIDAS.ToList();
                        control.SAX_PARTIDAS = null;
                        registro             = base.Insert(control, true);
                        partidas.ForEach(c => c.RC_REGISTRO_CONTROL = registro.RC_REGISTRO_CONTROL);
                        EFBatchOperation.For(db, db.SAX_PARTIDAS).InsertAll(partidas, batchSize: 1500);
                    }
                    trx.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(registro);
        }
コード例 #5
0
        public ActionResult Update(string varCode, string newVarName, string newVarCID)
        {
            var elementvarContext = new DBModelEntities();
            IList <ElementVariable> elementvars = elementvarContext.ElementVariables.ToList();
            ElementVariable         elementVar  = db.ElementVariables.Find(Convert.ToInt32(varCode));

            //2. change element name in disconnected mode (out of ctx scope)
            elementVar.CID  = Convert.ToInt32(newVarCID);
            elementVar.Name = newVarName;

            db.SaveChanges();
            //foreach (ElementsVariablesViewModel i in ElementsVariablesViewModel.ElementsVariablesList)
            //{
            //    if (i.ElementCode == varCode)
            //    {
            //        i.ElementCode = newEleCode;
            //        i.ElementName = newEleName;
            //        i.VariableCID = newVarCID;
            //        i.VariableCode = newVarCode;
            //        i.VariableName = newVarName;
            //        i.DateSet = DateTime.Today;

            //        return Json(new
            //        {
            //            aaData = ElementsVariablesViewModel.ElementsVariablesList.Select(x => new[] { x.ElementCode, x.ElementName, x.VariableCode, x.VariableName, x.VariableCID, x.DateSet.ToString(), x.CreatedBy })
            //        }, JsonRequestBehavior.AllowGet);
            //    }
            //}

            return(Json(new
            {
                aaData = elementvars.Select(x => new[] { x.Code.ToString(), x.Name, x.CID.ToString() })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
        public ActionResult Delete(string EleID)
        {
            var             elementContext = new DBModelEntities();
            IList <Element> elements       = elementContext.Elements.ToList();
            Element         element        = db.Elements.Find(Convert.ToInt32(EleID));

            db.Elements.Remove(element);
            db.SaveChanges();

            //foreach(ElementsViewModel i in ElementsViewModel.ElementsList)
            //foreach (Element i in Element.ElementsList)
            //{
            //    if (i.Code.ToString() == EleID)
            //    {
            //        Element.ElementsList.Remove(i);
            //        return Json(new
            //        {
            //            //aaData = ElementsViewModel.ElementsList.Select(x => new[] { x.ElementId, x.ElementName, x.DateSet.ToString(), x.CreatedBy })
            //            aaData = Element.ElementsList.Select(x => new[] { x.Code.ToString(), x.Name, x.CreatedOn.ToString(), x.CreatedBy })
            //        }, JsonRequestBehavior.AllowGet);
            //    }
            //}

            return(Json(new
            {
                //aaData = ElementsViewModel.ElementsList.Select(x => new[] { x.ElementId, x.ElementName, x.DateSet.ToString(), x.CreatedBy })
                aaData = elements.Select(x => new[] { x.Code.ToString(), x.Name, x.CreatedOn.ToString(), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
        public IQueryable <SAX_CUENTA_CONTABLE> ListarCuentasContables(string userId)
        {
            try
            {
                DBModelEntities db     = new DBModelEntities();
                var             result = (from p in db.SAX_PARTIDAS_TEMP
                                          join ct in db.SAX_COMPROBANTE_DETALLE on p.PA_REGISTRO equals ct.PA_REGISTRO
                                          join c in db.SAX_COMPROBANTE on ct.TC_ID_COMPROBANTE equals c.TC_ID_COMPROBANTE
                                          join cc in db.SAX_CUENTA_CONTABLE on p.PA_CTA_CONTABLE equals cc.CO_CUENTA_CONTABLE + cc.CO_COD_AUXILIAR + cc.CO_NUM_AUXILIAR
                                          where c.TC_ESTATUS == 37 &&
                                          p.PA_USUARIO_CREACION == userId
                                          select cc);

                if (result.Count() > 0)
                {
                    var resultFormated = result.Select(x => new SAX_CUENTA_CONTABLE
                    {
                        CO_CUENTA_CONTABLE    = x.CO_CUENTA_CONTABLE,
                        CO_COD_AUXILIAR       = x.CO_COD_AUXILIAR,
                        CO_NUM_AUXILIAR       = x.CO_NUM_AUXILIAR,
                        CO_COD_CONCILIA       = x.CO_COD_CONCILIA,
                        CO_ID_CUENTA_CONTABLE = x.CO_ID_CUENTA_CONTABLE
                    });
                    return(resultFormated);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #8
0
        public ActionResult SatinAl(Satis model)
        {
            try
            {
                DBModelEntities db  = new DBModelEntities();
                Satis           emp = new Satis();
                emp.MusteriAdi    = model.MusteriAdi;
                emp.E_Posta       = model.E_Posta;
                emp.MusteriSoyadi = model.MusteriSoyadi;
                emp.Adres1        = model.Adres1;
                emp.Adres2        = model.Adres2;
                emp.PostaKodu     = model.PostaKodu;
                emp.Tarih         = model.Tarih;
                emp.Telefon       = model.Telefon;
                db.Satis.Add(emp);
                db.SaveChanges();
                int latestEmpId = emp.ID;
                ViewBag.Message = "Satın Alındı";
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(RedirectToAction("SatinAlma"));
        }
コード例 #9
0
ファイル: HomeController.cs プロジェクト: bdbrown4/PlanSoft
        public JsonResult firstNameLastName(string fname, string lname)
        {
            var             accountContext = new DBModelEntities();
            IList <Account> accountlist    = accountContext.Accounts.ToList();

            var userNameList = accountlist.Select(x => x.Username);

            foreach (string userName in userNameList)
            {
                var fnameList = accountlist.Where(x => x.Username.Equals(userName)).Select(x => x.First);
                var lnameList = accountlist.Where(x => x.Username.Equals(userName)).Select(x => x.Last);
                foreach (string obj in fnameList)
                {
                    if (userName.Equals(User.Identity.Name))
                    {
                        fname = obj;
                    }
                }
                foreach (string obj in lnameList)
                {
                    if (userName.Equals(User.Identity.Name))
                    {
                        lname = obj;
                    }
                }
            }

            return(Json(new
            {
                fname, lname
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #10
0
        public ActionResult Update(string varCode, string NewAttribCode, string NewAttribName, string NewVarName, string NewVarCode)
        {
            var attributeContext = new DBModelEntities();
            IList <AttributeVariable> attributeVars = attributeContext.AttributeVariables.ToList();
            AttributeVariable         attribVar     = db.AttributeVariables.Find(Convert.ToInt32(varCode));

            //2. change element name in disconnected mode (out of ctx scope)
            //attribVar.Code = Convert.ToInt32(NewVarCode);
            attribVar.Name = NewVarName;

            db.SaveChanges();

            /*   foreach (AttributesVariablesViewModel i in AttributesVariablesViewModel.AttributesVariablesList)
             * {
             *    if (i.AttributeCode == varCode)
             *    {
             *        i.AttributeCode = NewAttribCode;
             *        i.AttributeName = NewAttribName;
             *        i.VariableCode = NewVarCode;
             *        i.VariableName = NewVarName;
             *        i.DateSet = DateTime.Today;
             *
             *        return Json(new
             *        {
             *            aaData = AttributesVariablesViewModel.AttributesVariablesList.Select(x => new[] { x.AttributeCode, x.AttributeName, x.VariableCode, x.VariableName, x.DateSet.ToString(), x.CreatedBy })
             *        }, JsonRequestBehavior.AllowGet);
             *    }
             * }
             */
            return(Json(new
            {
                //aaData = AttributesVariablesViewModel.AttributesVariablesList.Select(x => new[] { x.AttributeCode, x.AttributeName, x.VariableCode, x.VariableName, x.DateSet.ToString(), x.CreatedBy })
                aaData = attributeVars.Select(x => new[] { x.Attribute.Code.ToString(), x.Attribute.Name, x.Code.ToString(), x.Name, x.CreatedOn.ToString(), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #11
0
        public ActionResult Delete(string AttribCode)
        {
            var attributeContext = new DBModelEntities();
            IList <AttributeVariable> attributeVars = attributeContext.AttributeVariables.ToList();
            AttributeVariable         attribute     = db.AttributeVariables.Find(Convert.ToInt32(AttribCode));

            db.AttributeVariables.Remove(attribute);
            db.SaveChanges();

            /*   foreach (AttributesVariablesViewModel i in AttributesVariablesViewModel.AttributesVariablesList)
             * {
             *     if (i.AttributeCode == AttribCode)
             *     {
             *         AttributesVariablesViewModel.AttributesVariablesList.Remove(i);
             *         return Json(new
             *         {
             *             aaData = AttributesVariablesViewModel.AttributesVariablesList.Select(x => new[] { x.AttributeCode, x.AttributeName, x.VariableCode, x.VariableName, x.DateSet.ToString(), x.CreatedBy })
             *         }, JsonRequestBehavior.AllowGet);
             *     }
             * }
             */

            return(Json(new
            {
                // aaData = AttributesVariablesViewModel.AttributesVariablesList.Select(x => new[] { x.AttributeCode, x.AttributeName, x.VariableCode, x.VariableName, x.DateSet.ToString(), x.CreatedBy })
                aaData = attributeVars.Select(x => new[] { x.Attribute.Code.ToString(), x.Attribute.Name, x.Code.ToString(), x.Name, x.CreatedOn.ToString(), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #12
0
        public ActionResult Add(/*string EleCode, */ string EleName, string varCode, string varName, string varCID, string Creator)
        {
            var elementvarContext = new DBModelEntities();
            IList <ElementVariable> elementvars = elementvarContext.ElementVariables.ToList();
            IList <Element>         elementList = elementvarContext.Elements.ToList();

            //ElementsVariablesViewModel.ElementsVariablesList.Add(new ElementsVariablesViewModel { ElementCode = EleCode, ElementName = EleName, VariableCID = varCID, VariableCode = varCode, VariableName = varName, DateSet = DateTime.Today, CreatedBy = Creator });
            //elementvars.Add(new ElementVariable { ECode = Convert.ToInt32(EleCode), CID = Convert.ToDecimal(varCID), Name = varName, CreatedOn = DateTime.Today, CreatedBy = Creator });

            foreach (var element in elementList)
            {
                if (element.Name == EleName)
                {
                    string          EleCode       = element.Code.ToString();
                    ElementVariable addElementVar = new ElementVariable();
                    addElementVar.ECode     = Convert.ToInt32(EleCode);
                    addElementVar.CID       = Convert.ToDecimal(varCID);
                    addElementVar.Name      = varName;
                    addElementVar.CreatedOn = DateTime.Today;
                    addElementVar.CreatedBy = Creator;
                    db.ElementVariables.Add(addElementVar);
                    db.SaveChanges();
                }
                else
                {
                    continue;
                }
            }

            return(Json(new
            {
                aaData = elementvars.Select(x => new[] { x.Code.ToString(), EleName, x.Name, x.CID.ToString(), x.CreatedOn.ToString(), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #13
0
        public ActionResult accountInfo()
        {
            var             accountContext = new DBModelEntities();
            IList <Account> accountList    = accountContext.Accounts.ToList();
            Account         accountModel   = db.Accounts.Find(User.Identity.Name);

            return(PartialView("_LoginPartial", accountModel));
        }
コード例 #14
0
 public ActionResult GetData()
 {
     using (DBModelEntities db = new DBModelEntities())
     {
         List <Employee> empList = db.Employees.ToList <Employee>();
         return(Json(new { data = empList }, JsonRequestBehavior.AllowGet));
     }
 }
コード例 #15
0
        public ActionResult DefineHTMLTable()
        {
            var          Context  = new DBModelEntities();
            IList <Plan> planList = Context.Plans.ToList();

            var attributeNames = planList.Select(x => x.Process.Attribute.Name).Distinct();

            return(Json(new { attributeNames = attributeNames }, JsonRequestBehavior.AllowGet));
        }
コード例 #16
0
        public ActionResult LoadAttributes()
        {
            var attributeContext = new DBModelEntities();
            IList <AttributeVariable> attributeVars = attributeContext.AttributeVariables.ToList();

            return(Json(new
            {
                aaData = attributeVars.Select(x => new[] { x.Attribute.Code.ToString(), x.Attribute.Name, x.Name, x.Code.ToString(), x.CreatedOn.ToString().Substring(0, 9), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #17
0
 public ActionResult Delete(int id)
 {
     using (DBModelEntities db = new DBModelEntities())
     {
         Employee emp = db.Employees.Where(x => x.EmployeeID == id).FirstOrDefault <Employee>();
         db.Employees.Remove(emp);
         db.SaveChanges();
         return(Json(new { success = true, message = "Deleted Successfully" }, JsonRequestBehavior.AllowGet));
     }
 }
コード例 #18
0
        public ActionResult Index(int?id)
        {
            var model = new DBModelEntities();

            model.Kategori    = db.Kategori;
            model.AltKategori = db.AltKategori;
            model.Urunler     = db.Urunler;
            ViewBag.Urunler   = db.Urunler.Where(x => x.AltKategoriID == id).ToList();
            return(View(model));
        }
コード例 #19
0
        public JsonResult DropDownElementVars(string element)
        {
            var Context = new DBModelEntities();
            IList <ElementVariable> VarList = Context.ElementVariables.ToList();

            return(Json(new
            {
                element = VarList.Where(x => x.Element.Name.Equals("Plan")).Select(x => x.Name)
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #20
0
        public ActionResult LoadElements()
        {
            var elementvarContext = new DBModelEntities();
            IList <ElementVariable> elementvars = elementvarContext.ElementVariables.ToList();

            return(Json(new
            {
                aaData = elementvars.Select(x => new[] { x.ECode.ToString(), x.Element.Name, x.Code.ToString(), x.Name, x.CID.ToString(), x.CreatedOn.ToString().Substring(0, 9), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #21
0
        public JsonResult DropDownAttributes(string attribute)
        {
            var attributeContext = new DBModelEntities();
            IList <Models.Attribute> attributelist = attributeContext.Attributes.ToList();

            return(Json(new
            {
                attribute = attributelist.Select(x => new[] { x.Name })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #22
0
        public JsonResult DropDownElementNames(string name)
        {
            var             elementContext = new DBModelEntities();
            IList <Element> elements       = elementContext.Elements.ToList();

            return(Json(new
            {
                name = elements.Select(x => new[] { x.Name })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #23
0
        public ActionResult LoadAttributes()
        {
            var attributeContext = new DBModelEntities();
            IList <Models.Attribute> attributes = attributeContext.Attributes.ToList();

            return(Json(new
            {
                //aaData = AttributesViewModel.AttributesList.Select(x => new[] { x.ElementCode, x.ElementName, x.AttributeCode, x.AttributeName, x.DateSet.ToString(), x.CreatedBy })
                aaData = attributes.Select(x => new[] { x.Element.Code.ToString(), x.Element.Name, x.Code.ToString(), x.Name, x.CreatedOn.ToString().Substring(0, 9), x.CreatedBy })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #24
0
        /// <summary>
        /// Returns the active object context
        /// </summary>
        public static DbContext GetObjectContext(string contextKey)
        {
            DbContext objectContext = GetCurrentObjectContext(contextKey);

            if (objectContext == null) // create and store the object context
            {
                objectContext = new DBModelEntities();
                StoreCurrentObjectContext(objectContext, contextKey);
            }
            return(objectContext);
        }
コード例 #25
0
        /*public void CreateAndRemove(List<SAX_MODULO_ROL> create)
         * {
         *  using (var trx = new TransactionScope())
         *  {
         *      using (var db = new DBModelEntities())
         *      {
         *          List<String> listDeleted= (List<String>)create.GroupBy(x => x.RL_ID_ROL).Select(grp => grp.First().RL_ID_ROL).ToList();
         *          EFBatchOperation.For(db, db.SAX_MODULO_ROL).Where(b => listDeleted.Any(c => c == b.RL_ID_ROL)).Delete();
         *          EFBatchOperation.For(db, db.SAX_MODULO_ROL).InsertAll(create);
         *      }
         *      trx.Complete();
         *  }
         * }*/

        public void CreateAndRemove(List <SAX_MODULO_ROL> create, List <int> remove)
        {
            using (var trx = new TransactionScope())
            {
                using (var db = new DBModelEntities())
                {
                    var countdelete = EFBatchOperation.For(db, db.SAX_MODULO_ROL).Where(b => remove.Any(c => c == b.MR_ID_MODULO_ROL)).Delete();
                    EFBatchOperation.For(db, db.SAX_MODULO_ROL).InsertAll(create);
                }
                trx.Complete();
            }
        }
コード例 #26
0
        public IQueryable <vi_PartidasAprobadas> ConsultaPartidaPorAprobar(string codEnterprise,
                                                                           string reference,
                                                                           decimal?importe,
                                                                           DateTime?trxDateIni,
                                                                           DateTime?trxDateFin,
                                                                           string ctaAccount,
                                                                           int?userArea,
                                                                           decimal?importeDesde,
                                                                           decimal?importeHasta)
        {
            try
            {
                int capManual           = Convert.ToInt16(BusinessEnumerations.TipoOperacion.CAPTURA_MANUAL);
                int capInicial          = Convert.ToInt16(BusinessEnumerations.TipoOperacion.CARGA_INICIAL);
                int status              = Convert.ToInt16(BusinessEnumerations.EstatusCarga.POR_APROBAR);
                int aprobado            = Convert.ToInt16(BusinessEnumerations.EstatusCarga.APROBADO);
                int anulado             = Convert.ToInt16(BusinessEnumerations.EstatusCarga.ANULADO);
                int porAprobar          = Convert.ToInt16(BusinessEnumerations.EstatusCarga.POR_CONCILIAR);
                int conciliacionAuto    = Convert.ToInt16(BusinessEnumerations.TipoConciliacion.AUTOMATICO);
                int conciliacionManual  = Convert.ToInt16(BusinessEnumerations.TipoConciliacion.MANUAL);
                int conciliacionParcial = Convert.ToInt16(BusinessEnumerations.TipoConciliacion.PARCIAL);
                int concilia            = Convert.ToInt16(BusinessEnumerations.Concilia.NO);

                DBModelEntities db = new DBModelEntities();
                var             resultComprobante = (from p in db.vi_PartidasAprobadas
                                                     join ct in db.SAX_COMPROBANTE_DETALLE on p.PA_REGISTRO equals ct.PA_REGISTRO into newgroup
                                                     //join com in db.SAX_COMPROBANTE on ct.TC_ID_COMPROBANTE equals com.TC_ID_COMPROBANTE
                                                     from cc in newgroup.DefaultIfEmpty()
                                                     where (p.PA_STATUS_PARTIDA == aprobado ||
                                                            p.PA_STATUS_PARTIDA == anulado || p.PA_STATUS_PARTIDA == porAprobar) &&
                                                     p.PA_ESTADO_CONCILIA == concilia
                                                     //&& p.PA_TIPO_CONCILIA != 43// quitar cuando comiencen los cambios de conciliacion y descomentar la linea de abajo
                                                     && ((p.PA_TIPO_CONCILIA == conciliacionAuto || p.PA_TIPO_CONCILIA == conciliacionManual || p.PA_TIPO_CONCILIA == 0 || p.PA_TIPO_CONCILIA == null) || (p.PA_TIPO_CONCILIA == conciliacionParcial && p.PA_ORIGEN_REFERENCIA == 61 && (p.PA_IMPORTE_PENDIENTE != 0 || p.PA_IMPORTE_PENDIENTE != null)))
                                                     //&& p.PA_TIPO_CONCILIA!= conciliacionManual
                                                     //&& p.PA_REFERENCIA != ""
                                                     //&& p.RC_COD_AREA == userArea
                                                     && (p.PA_REFERENCIA == null ? true : p.PA_REFERENCIA.Trim() != string.Empty) &&
                                                     (p.PA_IMPORTE >= (importeDesde == null ? p.PA_IMPORTE : importeDesde)) &&
                                                     (p.PA_IMPORTE <= (importeHasta == null ? p.PA_IMPORTE : importeHasta)) &&
                                                     p.PA_COD_EMPRESA == (codEnterprise == null ? p.PA_COD_EMPRESA : codEnterprise) &&
                                                     p.PA_CTA_CONTABLE == (ctaAccount == null ? p.PA_CTA_CONTABLE : ctaAccount) &&
                                                     p.PA_REFERENCIA == (reference == null ? p.PA_REFERENCIA : reference) &&
                                                     p.PA_FECHA_TRX >= (trxDateIni == null ? p.PA_FECHA_TRX : trxDateIni) &&
                                                     p.PA_FECHA_TRX <= (trxDateFin == null ? p.PA_FECHA_TRX : trxDateFin)
                                                     select p).Distinct();
                return(resultComprobante);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #27
0
        public JsonResult DropDownAttributeVars(string attribute)
        {
            var attributeContext = new DBModelEntities();
            IList <Models.Attribute> attribList = attributeContext.Attributes.ToList();

            IList <Models.AttributeVariable> attribVarList = attributeContext.AttributeVariables.ToList();

            return(Json(new
            {
                attribute = attribList.Select(x => new { x.Name, x.Code, x.Input }),
                attributeVar = attribVarList.Select(x => new { x.Name, x.ACode })
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #28
0
        public ActionResult UyeOl(Uyeler uye)
        {
            using (DBModelEntities dbModel = new DBModelEntities())
            {
                dbModel.Uyeler.Add(uye);
                dbModel.SaveChanges();
            }
            ModelState.Clear();
            ViewBag.SuccessMessage = "Registration Successful";


            return(RedirectToAction("KayitOl", new Uyeler()));
        }
コード例 #29
0
 public ActionResult AddOrEdit(int id = 0)
 {
     if (id == 0)
     {
         return(View(new Employee()));
     }
     else
     {
         using (DBModelEntities db = new DBModelEntities())
         {
             return(View(db.Employees.Where(x => x.EmployeeID == id).FirstOrDefault <Employee>()));
         }
     }
 }
コード例 #30
0
        public JsonResult DropDownElementCodes(string code)
        {
            var             elementContext = new DBModelEntities();
            IList <Element> elements       = elementContext.Elements.ToList();

            return(Json(new
            {
                code = elements.Select(x => new[] { x.Code.ToString() })
            }, JsonRequestBehavior.AllowGet));
            //return Json(new
            //{
            //    attribute = AttributesViewModel.AttributesList.Select(x => new[] { x.AttributeName })
            //}, JsonRequestBehavior.AllowGet);
        }