Exemplo n.º 1
0
        public ConfigureAccountModel GetDetailsOfAccount(int AccountConfId)
        {
            var result = ent.GL_AccountConf.Where(x => x.AccountConfId == AccountConfId).FirstOrDefault();
            ConfigureAccountModel model = new ConfigureAccountModel();

            model.LedgerId        = result.GL_Ledgers.LedgerId;
            model.AccountConfName = result.AccountConfName;
            model.AccountConfId   = result.AccountConfId;
            return(model);
        }
Exemplo n.º 2
0
        public IEnumerable <ConfigureAccountModel> GetConfigureAccountList(int productId)
        {
            List <ConfigureAccountModel> model = new List <ConfigureAccountModel>();
            var result = ent.GL_AccountConf.Where(x => x.ProductId == productId);

            foreach (var item in result)
            {
                ConfigureAccountModel obj = new ConfigureAccountModel();
                obj.AccountConfId   = item.AccountConfId;
                obj.AccountConfName = item.AccountConfName;
                obj.AccountValue    = item.AccountConfId.ToString();
                obj.LedgerId        = item.MappedLedgerId;
                model.Add(obj);
            }
            return(model.AsEnumerable());
        }
Exemplo n.º 3
0
        public ActionResult Index(ConfigureAccountModel obj, string KeyValue, int[] AccountValue)
        {
            //SetDropDownValue(obj.ProductId);
            ConfigureAccountModel model = new ConfigureAccountModel();

            string[] str = KeyValue.Split(',');

            for (int i = 1; i < str.Length; i++)
            {
                if (str[i] == "")
                {
                    continue;
                }
                int LedgerId = int.Parse(str[i]);

                ser.SaveConfigureAccount(AccountValue.ElementAt(i - 1), obj.ProductId, LedgerId);
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
        public ActionResult Index(int?productId)
        {
            ConfigureAccountModel model = new ConfigureAccountModel();

            model.KeyValue = new Dictionary <string, int>();
            SetDropDownValue(productId);
            if (Request.IsAjaxRequest())
            {
                if (productId == null)
                {
                    productId = 0;
                }
                model.ConfigureAccountList = ser.GetConfigureAccountList(productId.Value);

                return(PartialView("ListPartial", model));
            }

            model.ConfigureAccountList = ser.GetConfigureAccountList(0);


            return(View());
        }