Example #1
0
        protected void NewApunteBancario(NotifyEntity item)
        {
            if (item.ETipoNotificacion != ETipoNotificacion.PagoTarjetaVencido)
            {
                if (((PaymentList)item.List).Count > 0)
                {
                    //PgMng.ShowInfoException("Seleccione un extracto pendiente de la tarjeta");

                    PaymentInfo    pg      = ((PaymentList)item.List)[0];
                    CreditCardInfo tarjeta = CreditCardInfo.Get(pg.OidTarjetaCredito, false);
                    PaymentInfo    pago    = PaymentInfo.GetByVencimientoTarjeta(tarjeta, pg.Vencimiento, false);

                    PagoFraccionadoTarjetaEditForm form = new PagoFraccionadoTarjetaEditForm(pago.Oid, ETipoPago.FraccionadoTarjeta, this);
                    form.ShowDialog();
                }
                return;
            }

            PaymentList list = (PaymentList)item.List;

            if (list.Count == 0)
            {
                PgMng.ShowInfoException("No existen extractos pendientes para esta tarjeta");
                return;
            }

            Library.Invoice.ModuleController.CreateApuntesBancarios(list);

            RefreshAction();
        }
Example #2
0
        private void SetSubtotales(TreeNode node)
        {
            NotifyEntity notify_entity = (NotifyEntity)node.Tag;

            if (notify_entity.ETipoNotificacion != ETipoNotificacion.Node && !notify_entity.SetTotal)
            {
                return;
            }

            if (node.Nodes.Count > 0)
            {
                notify_entity.Total = 0;
            }

            foreach (TreeNode item in node.Nodes)
            {
                SetSubtotales(item);
                if (item.Checked)
                {
                    notify_entity.Total += ((NotifyEntity)item.Tag).Total;
                }
            }

            node.Text = notify_entity.FullTitle;
        }
Example #3
0
        public ActionResult GetSystemMessage([FromRoute] decimal id)
        {
            var query = from d in _context.D_NOTIFYS
                        where d.NOTIFY_ID == id
                        select d;

            if (!query.Any())
            {
                return(Ok(new Result
                {
                    Status = 200,
                    Message = string.Empty,
                    Data = string.Empty
                }));
            }

            D_NOTIFY notify = query.Single();

            NotifyEntity entity = new NotifyEntity();

            entity.notifyId        = notify.NOTIFY_ID;
            entity.notifyType      = notify.NOTIFY_TYPE;
            entity.objectId        = notify.OBJECT_ID;
            entity.notifyDate      = notify.NOTIFY_DATE;
            entity.userSendId      = notify.USER_SEND_ID;
            entity.userReceiveId   = notify.USER_RECIEVE_ID;
            entity.receiveModeUser = notify.RECEIVE_MODE_USER;
            entity.content         = notify.CONTENT;

            if (entity.notifyType == (int)NotifyType.System)
            {
                var user = from d in _context.M_USERS
                           where d.USER_ID == notify.USER_RECIEVE_ID
                           select d;

                M_USER userM = user.Single();

                var message = from d in _context.M_SYSTEM_MESSAGES
                              where d.MESSAGE_CD == entity.objectId &&
                              d.LANGUAGE_TYPE == userM.LANGUAGE_TYPE
                              select d;

                if (message.Any())
                {
                    entity.content = message.SingleOrDefault().MESSAGE_CONTENT;
                }
            }

            return(Ok(new Result
            {
                Status = 200,
                Message = string.Empty,
                Data = entity.content
            }));
        }
Example #4
0
 /// <summary>
 /// 保存分类表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="notify">分类实体</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, NotifyEntity notify)
 {
     try
     {
         service.SaveForm(keyValue, notify);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #5
0
 protected override void OpenMngFormAction(NotifyEntity item)
 {
     switch (item.ETipoEntidad)
     {
     case ETipoEntidad.Pago:
     {
         PaymentMngForm form = new PaymentMngForm(false, _parent, ETipoPago.Todos, (PaymentList)item.List);
         FormMngBase.Instance.ShowFormulario(form, this);
         form.ViewMode = molView.Enbebbed;
         form.Text     = item.Title;
         form.Left     = this.Right + 1;
         form.Width   -= this.Width;
         form.FitColumns();
     }
     break;
     }
 }
Example #6
0
        protected override void OpenMngFormAction(NotifyEntity item)
        {
            switch (item.ETipoEntidad)
            {
            case ETipoEntidad.Pago:
            case ETipoEntidad.CreditCardStatement:
            {
                if (item.List == null)
                {
                    item.List = PaymentList.GetByCreditCardStatement(item.Oid, false);
                    SetTotales();
                }

                PaymentMngForm form = new PaymentMngForm(false, _parent, ETipoPago.Todos, (PaymentList)item.List);
                FormMngBase.Instance.ShowFormulario(form, this);
                form.ViewMode = molView.Enbebbed;
                form.Text     = item.Title;
                form.Left     = this.Right + 1;
                form.Width   -= this.Width;
                form.FitColumns();
            }
            break;

            case ETipoEntidad.Caja:
            {
                if (item.List == null)
                {
                    item.List = CashLineList.GetByCreditCardStatement(item.Oid, false);
                    SetTotales();
                }

                CashLineMngForm form = new CashLineMngForm(false, _parent, (CashLineList)item.List, 1);
                form.ViewMode = molView.Enbebbed;
                FormMngBase.Instance.ShowFormulario(form, this);
                form.Text   = item.Title;
                form.Left   = this.Right + 1;
                form.Width -= this.Width;
                form.FitColumns();
            }
            break;
            }
        }
Example #7
0
        public void SendVerify(string Mobile)
        {
            try
            {
                if (!ValidateUtil.IsMobile(Mobile))
                {
                    throw new Exception("请输入正确的手机号");
                }
                var          time         = DateTime.Now;
                Random       rad          = new Random();
                int          code         = rad.Next(1000, 1000000);
                NotifyEntity notifyEntity = new NotifyEntity();

                notifyEntity.Mobile      = Mobile;
                notifyEntity.NotifyId    = Guid.NewGuid().ToString();
                notifyEntity.Code        = code.ToString();
                notifyEntity.CreateDate  = time;
                notifyEntity.ExpiresDate = time.AddMinutes(int.Parse(Config.GetValue("VerifyExpiration")));
                notifyEntity.Type        = "1";
                notifyEntity.Status      = false;
                notifyBLL.SaveForm("", notifyEntity);

                var result = CCPSMSNotifyUtil.TestNotify(Mobile, code.ToString(), Config.GetValue("VerifyExpiration"));
                if (result == 0)
                {
                    notifyEntity.Status = true;
                    notifyBLL.UpdateNotify(Mobile, notifyEntity.Code);
                }
            }
            catch (Exception ex)
            {
                //return Error(ex.Message);
            }
            //ReturnResult rst = CCPSMSNotifyUtil.TestNotify("18708508278", "2222", "3");
            //ReturnResult rst1 = CCPSMSNotifyUtil.TestNotify("15208547251","2222","3");
        }
Example #8
0
        /// <summary>
        /// LUA结构支持
        /// </summary>
        /// <returns></returns>
        public override void GetLuaStruct(StringBuilder code)
        {
            base.GetLuaStruct(code);
            int idx;

            if (!string.IsNullOrWhiteSpace(Friend))
            {
                code.AppendLine($@"['Friend'] = '{Friend.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Friend'] = nil,");
            }

            code.AppendLine($@"['FriendKey'] ='{FriendKey}',");

            code.AppendLine($@"['LocalCommand'] ={(LocalCommand.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(CommandId))
            {
                code.AppendLine($@"['CommandId'] = '{CommandId.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['CommandId'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(NotifyEntity))
            {
                code.AppendLine($@"['NotifyEntity'] = '{NotifyEntity.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['NotifyEntity'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(ClientEntity))
            {
                code.AppendLine($@"['ClientEntity'] = '{ClientEntity.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ClientEntity'] = nil,");
            }

            code.AppendLine($@"['IsCommandResult'] ={(IsCommandResult.ToString().ToLower())},");

            code.AppendLine($@"['IsMulit'] ={(IsMulit.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(Org))
            {
                code.AppendLine($@"['Org'] = '{Org.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Org'] = nil,");
            }

            if (EsEntity != null)
            {
                code.AppendLine($@"['EsEntity'] = {EsEntity.GetLuaStruct()},");
            }

            if (LocalEntity != null)
            {
                code.AppendLine($@"['LocalEntity'] = {LocalEntity.GetLuaStruct()},");
            }
        }
Example #9
0
        protected override void BuildTree()
        {
            if (List == null)
            {
                return;
            }

            TreeNode node = null;

            NewRootNode("Extractos de Tarjetas de Crédito");

            int          index = 0;
            PaymentList  pagos;
            NotifyEntity item;

            foreach (CreditCardInfo tarjeta in TarjetasList)
            {
                node                  = new TreeNode();
                node.Text             = tarjeta.Nombre;
                node.Tag              = new NotifyEntity(ETipoNotificacion.Node, node.Text, true);
                node.SelectedImageKey = TARJETA_IMAGE_KEY;
                node.ImageKey         = TARJETA_IMAGE_KEY;
                Tree_TV.TopNode.Nodes.Add(node);

                //Extracto pendiente
                pagos = PagosList[index++];

                item = new NotifyEntity(ETipoNotificacion.PagoTarjetaVencido
                                        , ETipoEntidad.Pago
                                        , pagos.Count
                                        , pagos.Total()
                                        , "Extracto de pagos pendientes"
                                        , pagos);

                node                  = new TreeNode();
                node.Name             = item.ETipoEntidad.ToString();
                node.Text             = item.FullTitle;
                node.Tag              = item;
                node.SelectedImageKey = Tree_TV.SelectedImageKey;
                node.ImageKey         = PAGO_IMAGE_KEY;
                node.Checked          = item.Checked;

                Tree_TV.TopNode.Nodes[Tree_TV.TopNode.Nodes.Count - 1].Nodes.Add(node);

                //Extractos cobrados
                BankLineList movs = MovimientosList[TarjetasList.IndexOf(tarjeta)];

                foreach (BankLineInfo mov in movs)
                {
                    pagos = PagosList[index++];

                    item = new NotifyEntity(ETipoNotificacion.ExtractoTarjeta
                                            , ETipoEntidad.Pago
                                            , pagos.Count
                                            , pagos.Total()
                                            , "Extracto del  " + mov.FechaOperacion.ToShortDateString()
                                            , pagos);

                    node                  = new TreeNode();
                    node.Name             = item.ETipoEntidad.ToString();
                    node.Text             = item.FullTitle;
                    node.Tag              = item;
                    node.SelectedImageKey = Tree_TV.SelectedImageKey;
                    node.ImageKey         = EXTRACTO_IMAGE_KEY;
                    node.Checked          = item.Checked;

                    Tree_TV.TopNode.Nodes[Tree_TV.TopNode.Nodes.Count - 1].Nodes.Add(node);
                }
            }

            Tree_TV.ExpandAll();

            SetTotales();
        }
Example #10
0
        protected override void BuildTree()
        {
            if (List == null)
            {
                return;
            }

            TreeNode node = null;

            NewRootNode("Extractos de Tarjetas de Crédito", false);

            NotifyEntity item;

            foreach (CreditCardInfo credit_card in CreditCards)
            {
                node                  = new TreeNode();
                node.Text             = credit_card.Nombre;
                node.Tag              = new NotifyEntity(ETipoNotificacion.Node, node.Text, true);
                node.SelectedImageKey = TARJETA_IMAGE_KEY;
                node.ImageKey         = TARJETA_IMAGE_KEY;
                Tree_TV.TopNode.Nodes.Add(node);

                //Extractos cobrados
                foreach (CreditCardStatementInfo statement in credit_card.Statements)
                {
                    //Active year filter
                    if (Library.Common.ModulePrincipal.GetUseActiveYear())
                    {
                        if (statement.DueDate.Year != Library.Common.ModulePrincipal.GetActiveYear().Year)
                        {
                            continue;
                        }
                    }

                    item = new NotifyEntity()
                    {
                        ETipoNotificacion = ETipoNotificacion.ExtractoTarjeta,
                        ETipoEntidad      = ETipoEntidad.CreditCardStatement,
                        Oid      = statement.Oid,
                        Title    = "Extracto de " + statement.DueDate.ToShortDateString(),
                        Total    = statement.Amount,
                        SetTotal = true
                    };

                    node                  = new TreeNode();
                    node.Name             = item.ETipoEntidad.ToString();
                    node.Text             = item.FullTitle;
                    node.Tag              = item;
                    node.SelectedImageKey = Tree_TV.SelectedImageKey;
                    node.ImageKey         = EXTRACTO_IMAGE_KEY;
                    node.Checked          = item.Checked;

                    Tree_TV.TopNode.Nodes[Tree_TV.TopNode.Nodes.Count - 1].Nodes.Add(node);

                    //Pagos
                    item = new NotifyEntity()
                    {
                        ETipoNotificacion = ETipoNotificacion.Node,
                        ETipoEntidad      = ETipoEntidad.Pago,
                        Oid      = statement.Oid,
                        Title    = "Pagos",
                        Total    = statement.Amount - statement.CashAmount,
                        SetTotal = true
                    };

                    TreeNode subnode = new TreeNode();
                    subnode.Name             = item.ETipoEntidad.ToString();
                    subnode.Text             = item.FullTitle;
                    subnode.Tag              = item;
                    subnode.SelectedImageKey = Tree_TV.SelectedImageKey;
                    subnode.ImageKey         = EXTRACTO_IMAGE_KEY;
                    subnode.Checked          = item.Checked;

                    node.Nodes.Add(subnode);

                    //Disposiciones en efectivo
                    item = new NotifyEntity()
                    {
                        ETipoNotificacion = ETipoNotificacion.Node,
                        ETipoEntidad      = ETipoEntidad.Caja,
                        Oid      = statement.Oid,
                        Title    = "Disposiciones en efectivo",
                        Total    = statement.CashAmount,
                        SetTotal = true
                    };

                    subnode                  = new TreeNode();
                    subnode.Name             = item.ETipoEntidad.ToString();
                    subnode.Text             = item.FullTitle;
                    subnode.Tag              = item;
                    subnode.SelectedImageKey = Tree_TV.SelectedImageKey;
                    subnode.ImageKey         = EXTRACTO_IMAGE_KEY;
                    subnode.Checked          = item.Checked;

                    node.Nodes.Add(subnode);
                }
            }

            Tree_TV.TopNode.Expand();

            SetTotales();
        }
Example #11
0
 protected virtual void OpenMngFormAction(NotifyEntity item)
 {
 }
        protected override void OpenMngFormAction(NotifyEntity item)
        {
            switch (item.ETipoEntidad)
            {
            case ETipoEntidad.Pago:
            {
                PaymentMngForm form = new PaymentMngForm(false, MainForm.Instance, ETipoPago.Todos, (PaymentList)item.List);
                FormMng.Instance.ShowFormulario(form, this);
                form.ViewMode = molView.Enbebbed;
                form.Text     = item.Title;
                form.Left     = this.Right + 1;
                form.Width   -= this.Width;
                form.FitColumns();
            }
            break;

            case ETipoEntidad.FacturaRecibida:
            {
                InputInvoiceMngForm form = new InputInvoiceMngForm(false, MainForm.Instance, ETipoFacturas.Todas, (InputInvoiceList)item.List);
                FormMng.Instance.ShowFormulario(form, this);
                form.ViewMode = molView.Enbebbed;
                form.Text     = item.Title;
                form.Left     = this.Right + 1;
                form.Width   -= this.Width;
                form.FitColumns();
            }
            break;

            case ETipoEntidad.Gasto:
            {
                ExpenseMngForm form = new ExpenseMngForm(false, MainForm.Instance, ECategoriaGasto.Todos, (ExpenseList)item.List);
                FormMng.Instance.ShowFormulario(form, this);
                form.ViewMode = molView.Enbebbed;
                form.Text     = item.Title;
                form.Left     = this.Right + 1;
                form.Width   -= this.Width;
                form.FitColumns();
            }
            break;

            case ETipoEntidad.FacturaEmitida:
            {
                InvoiceMngForm form = new InvoiceMngForm(false, MainForm.Instance, (OutputInvoiceList)item.List, ETipoFacturas.Todas);
                FormMng.Instance.ShowFormulario(form, this);
                form.ViewMode = molView.Enbebbed;
                form.Text     = item.Title;
                form.Left     = this.Right + 1;
                form.Width   -= this.Width;
                form.FitColumns();
            }
            break;

            case ETipoEntidad.Cobro:
            {
                CobroMngForm form = new CobroMngForm(false, MainForm.Instance, (CobroList)item.List, ETipoCobro.Todos);
                FormMng.Instance.ShowFormulario(form, this);
                form.ViewMode = molView.Enbebbed;
                form.Text     = item.Title;
                form.Left     = this.Right + 1;
                form.Width   -= this.Width;
                form.FitColumns();
            }
            break;
            }
        }
Example #13
0
        public ActionResult GetNotifyList([FromRoute] decimal id, [FromRoute] decimal modeUser)
        {
            int notifyMax = int.Parse(Utility.GetDefineValue(Constant.NOTIFY_NUMBER_MAX).value);

            var query = (from d in _context.D_NOTIFYS
                         where d.READED_FLG == (int)ReadedFlg.New &&
                         d.RECEIVE_MODE_USER == modeUser &&
                         d.USER_RECIEVE_ID == id
                         orderby d.NOTIFY_DATE descending
                         select d).Take(notifyMax);

            var user = from d in _context.M_USERS
                       where d.USER_ID == id
                       select d;

            if (!query.Any() || !user.Any())
            {
                return(Ok(new Result
                {
                    Status = 404,
                    Message = string.Empty,
                    Data = false
                }));
            }

            string languageType = user.Single().LANGUAGE_TYPE.Trim();

            List <D_NOTIFY>     notifyList = query.ToList();
            List <NotifyEntity> entityList = new List <NotifyEntity>();

            foreach (D_NOTIFY notify in notifyList)
            {
                NotifyEntity entity = new NotifyEntity();
                entity.notifyId        = notify.NOTIFY_ID;
                entity.notifyType      = notify.NOTIFY_TYPE;
                entity.objectId        = notify.OBJECT_ID;
                entity.notifyDate      = notify.NOTIFY_DATE;
                entity.userSendId      = notify.USER_SEND_ID;
                entity.userReceiveId   = notify.USER_RECIEVE_ID;
                entity.receiveModeUser = notify.RECEIVE_MODE_USER;
                entity.content         = notify.CONTENT;

                if (notify.NOTIFY_TYPE == (int)NotifyType.Estimation)
                {
                    entity.content = string.Format(Utility.GetMessageInfo(_context, languageType, notify.NOTIFY_TYPE).messageContent, notify.CONTENT);
                }
                else if (notify.NOTIFY_TYPE == (int)NotifyType.Job)
                {
                    string status = string.Empty;

                    var queryHistory = from d in _context.D_HISTORYS
                                       join m in _context.M_NAMES on d.STATUS equals m.CD
                                       where d.EXCHANGE_ID == notify.OBJECT_ID &&
                                       m.TYPE_NAME == "HISTORY_STATUS"
                                       select m;

                    if (queryHistory.Any())
                    {
                        if (string.IsNullOrEmpty(languageType) || languageType.Equals(Constant.LANGUAGE_VN))
                        {
                            status = queryHistory.Single().NAME;
                        }
                        else
                        {
                            status = queryHistory.Single().NAME_EN;
                        }

                        //entity.Content = Utility.GetMessageInfo(languageType, notify.NOTIFY_TYPE).MessageContent;
                        entity.content = string.Format(Utility.GetMessageInfo(_context, languageType, notify.NOTIFY_TYPE).messageContent, notify.CONTENT, status);
                    }
                }
                else
                {
                    entity.content = string.Format(Utility.GetSystemMessageInfo(_context, languageType, notify.OBJECT_ID).message);
                }

                entityList.Add(entity);
            }

            return(Ok(new Result
            {
                Status = 200,
                Message = string.Empty,
                Data = entityList
            }));
        }
Example #14
0
        public ActionResult GetNotifyById([FromRoute] decimal id)
        {
            var query = from d in _context.D_NOTIFYS
                        where d.NOTIFY_ID == id
                        select d;

            if (!query.Any())
            {
                return(Ok(new Result
                {
                    Status = 404,
                    Message = string.Empty,
                    Data = false
                }));
            }

            D_NOTIFY notify = query.Single();

            NotifyEntity entity = new NotifyEntity();

            entity.notifyId        = notify.NOTIFY_ID;
            entity.notifyType      = notify.NOTIFY_TYPE;
            entity.objectId        = notify.OBJECT_ID;
            entity.notifyDate      = notify.NOTIFY_DATE;
            entity.userSendId      = notify.USER_SEND_ID;
            entity.userReceiveId   = notify.USER_RECIEVE_ID;
            entity.receiveModeUser = notify.RECEIVE_MODE_USER;
            entity.content         = notify.CONTENT;

            var user = from d in _context.M_USERS
                       where d.USER_ID == notify.USER_RECIEVE_ID
                       select d;

            if (!user.Any())
            {
                return(Ok(new Result
                {
                    Status = 404,
                    Message = string.Empty,
                    Data = false
                }));
            }

            string languageType = user.Single().LANGUAGE_TYPE;

            if (notify.NOTIFY_TYPE == (int)NotifyType.Estimation)
            {
                entity.content = string.Format(Utility.GetMessageInfo(_context, languageType, notify.NOTIFY_TYPE).messageContent, notify.CONTENT);
            }
            else if (notify.NOTIFY_TYPE == (int)NotifyType.Job)
            {
                string status = string.Empty;

                var queryHistory = from d in _context.D_HISTORYS
                                   join m in _context.M_NAMES on d.STATUS equals m.CD
                                   where d.EXCHANGE_ID == notify.OBJECT_ID &&
                                   m.TYPE_NAME == "HISTORY_STATUS"
                                   select m;

                if (queryHistory.Any())
                {
                    if (string.IsNullOrEmpty(languageType) || languageType.Equals(Constant.LANGUAGE_VN))
                    {
                        status = queryHistory.Single().NAME;
                    }
                    else
                    {
                        status = queryHistory.Single().NAME_EN;
                    }

                    entity.content = string.Format(Utility.GetMessageInfo(_context, languageType, notify.NOTIFY_TYPE).messageContent, notify.CONTENT, status);
                }
            }
            else
            {
                entity.content = string.Format(Utility.GetSystemMessageInfo(_context, languageType, notify.OBJECT_ID).message);
            }

            return(Ok(new Result
            {
                Status = 200,
                Message = string.Empty,
                Data = entity
            }));
        }