Beispiel #1
0
 /// <summary>
 /// حذف يك گروه حساب
 /// </summary>
 /// <param name="groupModel"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding RemovePeopleGroup(Models.PeopleGroup groupModel, bool confirmDeleteSubdivision)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_deletePeopleGroup"))
         {
             repo.cmd.Parameters.AddWithValue("@id", groupModel.Id);
             //repo.cmd.Parameters.AddWithValue("@confirmDeleteSubdivision", confirmDeleteSubdivision);
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
Beispiel #2
0
 /// <summary>
 /// ويرايش گروه اشخاص
 /// </summary>
 /// <param name="groupModel"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding UpdatePeopleGroup(Models.PeopleGroup groupModel)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_updatetPeopleGroup"))
         {
             repo.cmd.Parameters.AddWithValue("@id", groupModel.Id);
             repo.cmd.Parameters.AddWithValue("@code", groupModel.Code);
             repo.cmd.Parameters.AddWithValue("@title", groupModel.Title);
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
        /// <summary>
        /// ثبت سال مالی جديد
        /// </summary>
        /// <param name="model">
        /// مدل پايه سال مالی
        /// </param>
        /// <returns></returns>
        public Models.ActionResultModelBinding InsertFiscalYear(Models.FiscalYear model)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_insertFiscalYear"))
                {
                    repo.cmd.Parameters.AddWithValue("@title", model.Title);
                    repo.cmd.Parameters.AddWithValue("@startDate", model.StartDate);
                    repo.cmd.Parameters.AddWithValue("@endDate", model.EndDate);
                    repo.cmd.Parameters.AddWithValue("@taxable", model.Taxable);
                    repo.cmd.Parameters.AddWithValue("@taxes", model.Taxes);
                    repo.cmd.Parameters.AddWithValue("@duties", model.Duties);
                    repo.cmd.Parameters.AddWithValue("@is_active", model.IsActive);

                    repo.ExecuteNonQuery();
                    return(new Models.ActionResultModelBinding
                    {
                        Message = repo.rMsg,
                        Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
                    });
                }
            }
            catch (Exception c)
            {
                return(new Models.ActionResultModelBinding
                {
                    Message = c.Message,
                    Status = Models.ActionResult.Failed
                });
            }
        }
 /// <summary>
 /// ویرایش الگوی سند
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding UpdatetDocumentTemplate(Models.DocumnetTemplateModelBinding model)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_updateAccountingDocumentTemplate"))
         {
             repo.cmd.Parameters.AddWithValue("@id", model.Id);
             repo.cmd.Parameters.AddWithValue("@title", model.Title);
             repo.cmd.Parameters.AddWithValue("@descriptionHead", model.DescriptionHeader);
             repo.cmd.Parameters.AddWithValue("@documentTypeId", model.DocumentTypeId);
             repo.cmd.Parameters.AddWithValue("@accountCode", model.TafsilCode);
             repo.cmd.Parameters.AddWithValue("@natureId", model.NatureId);
             repo.cmd.Parameters.AddWithValue("@descriptionRow", model.DescriptionRow);
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
Beispiel #5
0
        /// <summary>
        /// ثبت مرکز هزینه جديد
        /// </summary>
        /// <param name="groupModel">
        /// مدل پايه مرکز هزینه
        /// </param>
        /// <returns></returns>
        public Models.ActionResultModelBinding InsertCostCenter(Models.CostCenter groupModel)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_insertCostCenter"))
                {
                    repo.cmd.Parameters.AddWithValue("@code", groupModel.Code);
                    repo.cmd.Parameters.AddWithValue("@title", groupModel.Title);

                    repo.ExecuteNonQuery();
                    return(new Models.ActionResultModelBinding
                    {
                        Message = repo.rMsg,
                        Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
                    });
                }
            }
            catch (Exception c)
            {
                return(new Models.ActionResultModelBinding
                {
                    Message = c.Message,
                    Status = Models.ActionResult.Failed
                });
            }
        }
 /// <summary>
 /// ويرايش حساب کل
 /// </summary>
 /// <param name="kolModel"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding UpdateKolAccount(Models.Kol kolModel)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_updateAccountingKol"))
         {
             repo.cmd.Parameters.AddWithValue("@id", kolModel.Id);
             repo.cmd.Parameters.AddWithValue("@code", kolModel.Code);
             repo.cmd.Parameters.AddWithValue("@title", kolModel.Title);
             repo.cmd.Parameters.AddWithValue("@natureId", kolModel.NatureId);
             repo.cmd.Parameters.AddWithValue("@isDefault", kolModel.IsDefault);
             repo.cmd.Parameters.AddWithValue("@groupId", kolModel.GroupId);
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
Beispiel #7
0
 /// <summary>
 /// ویرایش الگو
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding UpdateTafsilAccountTemplate(Models.TafsilAccountTemplateModelBinding model)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_updateTafsilAccountTemplate"))
         {
             repo.cmd.Parameters.AddWithValue("@id", model.Id);
             repo.cmd.Parameters.AddWithValue("@entityId", model.EntityId);
             repo.cmd.Parameters.AddWithValue("@tafsiliGroupId", model.TafsiliGroupId);
             repo.cmd.Parameters.AddWithValue("@peopleGroupId", model.PeopleGroupId);
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
        /// <summary>
        /// ثبت گروه تفصیلی جدید
        /// </summary>
        /// <param name="model">
        /// مدل پايه گروه تفصیلی
        /// </param>
        /// <returns></returns>
        public Models.ActionResultModelBinding InsertTafsiliGroupAccount(Models.TafsiliGroup model)
        {
            try
            {
                using (var repo = new Repository.Repository(this, "usp_insertTafisiliGroup"))
                {
                    repo.cmd.Parameters.AddWithValue("@code", model.Code);
                    repo.cmd.Parameters.AddWithValue("@title", model.Title);
                    repo.cmd.Parameters.AddWithValue("@editable", model.Editable);

                    repo.ExecuteNonQuery();
                    return(new Models.ActionResultModelBinding
                    {
                        Message = repo.rMsg,
                        Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
                    });
                }
            }
            catch (Exception c)
            {
                return(new Models.ActionResultModelBinding
                {
                    Message = c.Message,
                    Status = Models.ActionResult.Failed
                });
            }
        }
Beispiel #9
0
 /// <summary>
 /// ثبت حساب معین جديد
 /// </summary>
 /// <param name="model">
 /// مدل پايه حساب معین
 /// </param>
 /// <returns></returns>
 public Models.ActionResultModelBinding InsertMoinAccount(Models.Moin model)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_insertAccountingMoein"))
         {
             repo.cmd.Parameters.AddWithValue("@code", model.Code);
             repo.cmd.Parameters.AddWithValue("@title", model.Title);
             repo.cmd.Parameters.AddWithValue("@natureId", model.NatureId);
             repo.cmd.Parameters.AddWithValue("@isDefault", model.IsDefault);
             repo.cmd.Parameters.AddWithValue("@isPermanent", model.IsPermanent);
             repo.cmd.Parameters.AddWithValue("@kolId", model.KolId);
             var param = repo.cmd.Parameters.AddWithValue("@tafiliGroupList", model.TafsiliGroupBinding);
             param.SqlDbType = System.Data.SqlDbType.Structured;
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
Beispiel #10
0
 /// <summary>
 /// ویرایش حساب تفصیل
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding UpdateTafsil(Models.Tafsil model)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_updateTafsilAccount"))
         {
             repo.cmd.Parameters.AddWithValue("@id", model.Id);
             repo.cmd.Parameters.AddWithValue("@code", model.Code);
             repo.cmd.Parameters.AddWithValue("@title", model.Title);
             repo.cmd.Parameters.AddWithValue("@automateDocumentTitle", model.TitleInAutomateDocument);
             repo.cmd.Parameters.AddWithValue("@isActive", model.IsActive);
             repo.cmd.Parameters.AddWithValue("@hasCostCenter", model.IsCostCenter);
             repo.cmd.Parameters.AddWithValue("@fk_typ_entity_type", model.EntityTypeId);
             repo.cmd.Parameters.AddWithValue("@tel", model.Tel);
             repo.cmd.Parameters.AddWithValue("@mobile", model.Mobile);
             repo.cmd.Parameters.AddWithValue("@address", model.Address);
             repo.cmd.Parameters.AddWithValue("@nationalCode", model.NationalCode);
             repo.cmd.Parameters.AddWithValue("@economyCode", model.EconomyCode);
             repo.cmd.Parameters.AddWithValue("@accTypeId", model.AccountTypeId);
             repo.cmd.Parameters.AddWithValue("@maxCredit", model.MaxCredit);
             var param = repo.cmd.Parameters.AddWithValue("@tafiliGroupList", model.TafsiliGroupBinding);
             param.SqlDbType = System.Data.SqlDbType.Structured;
             var param1 = repo.cmd.Parameters.AddWithValue("@peopleGroupList", model.PeopleGroupBinding);
             param1.SqlDbType = System.Data.SqlDbType.Structured;
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }
Beispiel #11
0
 /// <summary>
 /// حذف حساب تفصیل
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Models.ActionResultModelBinding DeleteTafsil(Models.Tafsil model)
 {
     try
     {
         using (var repo = new Repository.Repository(this, "usp_updateTafsilAccount"))
         {
             repo.cmd.Parameters.AddWithValue("@id", model.Id);
             repo.ExecuteNonQuery();
             return(new Models.ActionResultModelBinding
             {
                 Message = repo.rMsg,
                 Status = repo.rCode == 1 ? Models.ActionResult.Success : Models.ActionResult.Failed
             });
         }
     }
     catch (Exception c)
     {
         return(new Models.ActionResultModelBinding
         {
             Message = c.Message,
             Status = Models.ActionResult.Failed
         });
     }
 }