Exemplo n.º 1
0
        /// <summary>
        /// دريافت ليست گروه هاي اشخاص
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.PeopleGroup> GetPeopleGroup(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getPeopleGroupList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;
                    repo.cmd.Parameters.AddWithValue("@search", search);
                    repo.ExecuteAdapter();
                    var info = repo.ds.Tables[0].AsEnumerable();
                    return(new Models.SelectResultModelBinding <Models.PeopleGroup>
                    {
                        Body = info.Select(i => new Models.PeopleGroup
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            Code = Convert.ToString(i.Field <object>("code")),
                            Title = Convert.ToString(i.Field <object>("title")),

                            SaveDateTime = Convert.ToDateTime(i.Field <object>("save_datetime"))
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
        /// <summary>
        /// دريافت ليست انواع اسناد
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.PublicResultModel> GettDocumentTypes(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getDocumentTypeList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;


                    repo.ExecuteAdapter();
                    var info = repo.ds.Tables[0].AsEnumerable();

                    return(new Models.SelectResultModelBinding <Models.PublicResultModel>
                    {
                        Body = info.Select(i => new Models.PublicResultModel()
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            Title = Convert.ToString(i.Field <object>("title")),
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// دریافت لیست موجودیت های سیستم
 /// </summary>
 /// <returns></returns>
 public Models.SelectResultModelBinding <Models.EntityModelBinding> GetEntities()
 {
     using (var repo = new Repository.Repository(this, "usp_getEntityList", true))
     {
         repo.pageNo     = 0;
         repo.seedNumber = 10;
         repo.ExecuteAdapter();
         var data = repo.ds.Tables[0].AsEnumerable();
         return(new Models.SelectResultModelBinding <Models.EntityModelBinding>
         {
             Body = data.Select(c => new Models.EntityModelBinding
             {
                 Id = Convert.ToInt32(c.Field <object>("id")),
                 Title = c.Field <object>("title").ToString()
             }).ToList(),
             TotalCount = repo.totalCount
         });
     }
 }
Exemplo n.º 4
0
 public List <Models.Nature> GetNatures()
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_getNatureList", true))
         {
             repo.ExecuteAdapter();
             var info = repo.ds.Tables[0].AsEnumerable();
             return((info.Select(i => new Models.Nature
             {
                 Id = Convert.ToInt16(i.Field <object>("id")),
                 Title = Convert.ToString(i.Field <object>("title"))
             })).ToList());
         }
     }
     catch (Exception c)
     {
         MessageBox.Show(c.Message);
         return(null);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// دريافت ليست حسابهای معین
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.Moin> GetMoinAccounts(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getAccountingMoinList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;

                    repo.cmd.Parameters.AddWithValue("@search", search);
                    repo.ExecuteAdapter();
                    var info             = repo.ds.Tables[0].AsEnumerable();
                    var tafsiliGroupList = repo.ds.Tables[1].AsEnumerable();
                    return(new Models.SelectResultModelBinding <Models.Moin>
                    {
                        Body = info.Select(i => new Models.Moin()
                        {
                            Id = Convert.ToInt32(i.Field <object>("moinId")),
                            Code = Convert.ToString(i.Field <object>("moinCode")),
                            Title = Convert.ToString(i.Field <object>("moinTitle")),
                            IsDefault = Convert.ToBoolean(i.Field <object>("moinIsDefault")),
                            NatureId = Convert.ToInt16(i.Field <object>("moinNature")),
                            NatureTitle = Convert.ToString(i.Field <object>("moinNatureTitle")),
                            KolId = Convert.ToInt32(i.Field <object>("kolId")),
                            KolTitle = Convert.ToString(i.Field <object>("kolTitle")),
                            KolCode = Convert.ToString(i.Field <object>("kolCode")),
                            MoinMap = Convert.ToString(i.Field <object>("moinMap")),
                            TafsiliGroupBinding = SetDataTable(tafsiliGroupList.Where(m => Convert.ToInt32(m.Field <object>("moinId")) == Convert.ToInt32(i.Field <object>("moinId"))).Select(c => Convert.ToInt64(c.Field <object>("id"))).ToList()),
                            TafsiliGroupBindingString = string.Join(",", tafsiliGroupList.Where(m => Convert.ToInt32(m.Field <object>("moinId")) == Convert.ToInt32(i.Field <object>("moinId"))).Select(c => c.Field <object>("title")).ToList())
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// دريافت ليست حسابهای تفصیل
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.Tafsil> GetTafsilAccounts(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getTafsilAccountList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;

                    repo.cmd.Parameters.AddWithValue("@search", search);
                    repo.ExecuteAdapter();
                    var info             = repo.ds.Tables[0].AsEnumerable();
                    var tafsiliGroupList = repo.ds.Tables[1].AsEnumerable();
                    var peopleGroupList  = repo.ds.Tables[2].AsEnumerable();
                    return(new Models.SelectResultModelBinding <Models.Tafsil>
                    {
                        Body = info.Select(i => new Models.Tafsil()
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            Code = Convert.ToString(i.Field <object>("code")),
                            Title = Convert.ToString(i.Field <object>("title")),
                            TafsilMap = tafsiliGroupList.Where(t => Convert.ToInt32(t.Field <object>("TafsilId")) == Convert.ToInt32(i.Field <object>("id"))).Select(h => h.Field <object>("full_path").ToString()).FirstOrDefault(),
                            TitleInAutomateDocument = Convert.ToString(i.Field <object>("automate_document_title")),
                            IsActive = Convert.ToBoolean(i.Field <object>("active")),
                            IsCostCenter = Convert.ToBoolean(i.Field <object>("cost_center")),
                            EntityTypeId = Convert.ToInt32(i.Field <object>("entityId")),
                            TafsiliGroupBindingString = string.Join(",", tafsiliGroupList.Where(m => Convert.ToInt32(m.Field <object>("TafsilId")) == Convert.ToInt32(i.Field <object>("id"))).Select(c => c.Field <object>("title")).ToList())
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
        /// <summary>
        /// دريافت ليست الگوی اسناد
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.DocumnetTemplateModelBinding> GettDocumentTemplates(int docTypeId, short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getTafsilAccountList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;

                    repo.cmd.Parameters.AddWithValue("@docTopId", docTypeId);
                    repo.ExecuteAdapter();
                    var info = repo.ds.Tables[0].AsEnumerable();

                    return(new Models.SelectResultModelBinding <Models.DocumnetTemplateModelBinding>
                    {
                        Body = info.Select(i => new Models.DocumnetTemplateModelBinding()
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            Title = Convert.ToString(i.Field <object>("title")),
                            TafsilCode = Convert.ToString(i.Field <object>("fk_account_code")),
                            DescriptionHeader = i.Field <object>("description_head").ToString(),
                            DescriptionRow = Convert.ToString(i.Field <object>("description_row")),
                            DocumentTypeId = Convert.ToInt32(i.Field <object>("docTypeId")),
                            DocumentTypeTitle = Convert.ToString(i.Field <object>("docTypeTitle")),
                            NatureId = Convert.ToString(i.Field <object>("fk_nature_id")),
                            NatureTitle = i.Field <object>("natureTitle").ToString()
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
        /// <summary>
        /// دريافت ليست سال های مالی
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.FiscalYear> GetFiscalYears(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getFiscalYearList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;


                    repo.ExecuteAdapter();
                    var info = repo.ds.Tables[0].AsEnumerable();

                    return(new Models.SelectResultModelBinding <Models.FiscalYear>
                    {
                        Body = info.Select(i => new Models.FiscalYear()
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            Title = Convert.ToString(i.Field <object>("title")),
                            StartDate = Convert.ToString(i.Field <object>("startDate")),
                            EndDate = Convert.ToString(i.Field <object>("endDate")),
                            Taxable = Convert.ToBoolean(i.Field <object>("taxable")),
                            Taxes = Convert.ToDecimal(i.Field <object>("taxes")),
                            Duties = Convert.ToDecimal(i.Field <object>("duties")),
                            IsActive = Convert.ToBoolean(i.Field <object>("is_active")),
                            Status = Convert.ToString(i.Field <object>("status")),
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// دريافت ليست حسابهای کل
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.Kol> GetKolAccounts(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getAccountKolList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;

                    repo.cmd.Parameters.AddWithValue("@search", search);
                    repo.ExecuteAdapter();
                    var info = repo.ds.Tables[0].AsEnumerable();
                    return(new Models.SelectResultModelBinding <Models.Kol>
                    {
                        Body = info.Select(i => new Models.Kol()
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            Code = Convert.ToString(i.Field <object>("code")),
                            Title = Convert.ToString(i.Field <object>("title")),
                            IsDefault = Convert.ToBoolean(i.Field <object>("is_default")),
                            NatureId = Convert.ToInt16(i.Field <object>("fk_nature_id")),
                            NatureTitle = Convert.ToString(i.Field <object>("natureTitle")),
                            GroupId = Convert.ToInt32(i.Field <object>("groupId")),
                            GroupTitle = Convert.ToString(i.Field <object>("groupTitle")),
                            GroupCode = Convert.ToString(i.Field <object>("groupCode")),
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// دريافت ليست الگوهای تعرف شده
        /// </summary>
        /// <param name="_pageNo">
        /// شماره صفحه
        /// </param>
        /// <param name="_seedNumber">
        /// تعداد ركوردهاي مدنظر براي مشاهده در خروجي
        /// </param>
        /// <returns></returns>
        public Models.SelectResultModelBinding <Models.TafsilAccountTemplateModelBinding> GetTafsilAccountTemplateList(short _pageNo = 0, short _seedNumber = 10, string search = null)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_getTafsilAccountTemplateList", true))
                {
                    pageNo     = _pageNo;
                    seedNumber = _seedNumber;

                    //repo.cmd.Parameters.AddWithValue("@search", search);
                    repo.ExecuteAdapter();
                    var info = repo.ds.Tables[0].AsEnumerable();

                    return(new Models.SelectResultModelBinding <Models.TafsilAccountTemplateModelBinding>
                    {
                        Body = info.Select(i => new Models.TafsilAccountTemplateModelBinding()
                        {
                            Id = Convert.ToInt32(i.Field <object>("id")),
                            EntityId = Convert.ToInt32(i.Field <object>("entityTypeId")),
                            EntityTitle = Convert.ToString(i.Field <object>("entityTypeTitle")),
                            TafsiliGroupId = Convert.ToInt32(i.Field <object>("tafsiliGroupId")),
                            TafsiliGroupTitle = Convert.ToString(i.Field <object>("tafsiliGroupTitle")),
                            PeopleGroupId = Convert.ToInt32(i.Field <object>("peopleGroupId")),
                            PeopleGroupTitle = Convert.ToString(i.Field <object>("peopleGroupTitle")),
                            Path = i.Field <object>("path").ToString()
                        }).ToList(),
                        TotalCount = repo.totalCount
                    });
                }
            }
            catch (Exception c)
            {
                System.Windows.MessageBox.Show(c.Message);
                return(null);
            }
        }