예제 #1
0
        public string InsertUpdateServiceCall(ServiceCallViewModel serviceCallVM)
        {
            try
            {
                AppUA appUA = Session["AppUA"] as AppUA;
                serviceCallVM.PSASysCommon             = new PSASysCommonViewModel();
                serviceCallVM.PSASysCommon.CreatedBy   = appUA.UserName;
                serviceCallVM.PSASysCommon.CreatedDate = _pSASysCommon.GetCurrentDateTime();
                serviceCallVM.PSASysCommon.UpdatedBy   = appUA.UserName;
                serviceCallVM.PSASysCommon.UpdatedDate = _pSASysCommon.GetCurrentDateTime();
                object ResultFromJS   = JsonConvert.DeserializeObject(serviceCallVM.DetailJSON);
                string ReadableFormat = JsonConvert.SerializeObject(ResultFromJS);
                serviceCallVM.ServiceCallDetailList = JsonConvert.DeserializeObject <List <ServiceCallDetailViewModel> >(ReadableFormat);
                ResultFromJS   = JsonConvert.DeserializeObject(serviceCallVM.CallChargeJSON);
                ReadableFormat = JsonConvert.SerializeObject(ResultFromJS);
                serviceCallVM.ServiceCallChargeList = JsonConvert.DeserializeObject <List <ServiceCallChargeViewModel> >(ReadableFormat);
                object result = _serviceCallBusiness.InsertUpdateServiceCall(Mapper.Map <ServiceCallViewModel, ServiceCall>(serviceCallVM));

                if (serviceCallVM.ID == Guid.Empty)
                {
                    return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Insertion successfull" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Updation successfull" }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = _appConstant.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
            }
        }
예제 #2
0
 public string GetDeliveryChallanDetailListByDeliveryChallanIDWithSaleOrder(Guid saleOrderID)
 {
     try
     {
         List <DeliveryChallanDetailViewModel> deliveryChallanItemViewModelList = new List <DeliveryChallanDetailViewModel>();
         if (saleOrderID != Guid.Empty)
         {
             List <SaleOrderDetailViewModel> saleOrderDetailVMList = Mapper.Map <List <SaleOrderDetail>, List <SaleOrderDetailViewModel> >(_saleOrderBusiness.GetSaleOrderDetailListBySaleOrderID(saleOrderID, false).Where(x => x.Qty != x.PrevDelQty).ToList());
             deliveryChallanItemViewModelList = (from saleOrderDetailVM in saleOrderDetailVMList
                                                 select new DeliveryChallanDetailViewModel
             {
                 ID = Guid.Empty,
                 DelvChallanID = Guid.Empty,
                 ProductID = saleOrderDetailVM.ProductID,
                 ProductModelID = saleOrderDetailVM.ProductModelID,
                 ProductSpec = saleOrderDetailVM.ProductSpec,
                 OrderQty = saleOrderDetailVM.Qty,
                 UnitCode = saleOrderDetailVM.UnitCode,
                 DelvQty = saleOrderDetailVM.Qty - saleOrderDetailVM.PrevDelQty,
                 SpecTag = saleOrderDetailVM.SpecTag,
                 PrevDelQty = saleOrderDetailVM.PrevDelQty,
                 Product = saleOrderDetailVM.Product,
                 ProductModel = saleOrderDetailVM.ProductModel,
                 Unit = saleOrderDetailVM.Unit,
             }).ToList();
         }
         return(JsonConvert.SerializeObject(new { Status = "OK", Records = deliveryChallanItemViewModelList, Message = "Success" }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConstant.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Records = "", Message = cm.Message }));
     }
 }
예제 #3
0
        public string GetDueDate(string Code, string InvDate = "")
        {
            try
            {
                string DuePaymentDueDateFormatted;
                SPAccounts.DataAccessObject.DTO.Common com = new SPAccounts.DataAccessObject.DTO.Common();
                DateTime Datenow = com.GetCurrentDateTime();
                PaymentTermsViewModel payTermsObj = Mapper.Map <PaymentTerms, PaymentTermsViewModel>(_paymentTermsBusiness.GetPayTermDetails(Code));
                if (InvDate == "")
                {
                    DuePaymentDueDateFormatted = Datenow.AddDays(payTermsObj.NoOfDays).ToString("dd-MMM-yyyy");
                }
                else
                {
                    DuePaymentDueDateFormatted = Convert.ToDateTime(InvDate).AddDays(payTermsObj.NoOfDays).ToString("dd-MMM-yyyy");
                }

                return(JsonConvert.SerializeObject(new { Result = "OK", Records = DuePaymentDueDateFormatted }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
 public string InsertUpdateIncomingCheque(DepositAndWithdrwalViewModel depositAndWithdrawalObj)
 {
     try
     {
         AppUA appUA = Session["AppUA"] as AppUA;
         depositAndWithdrawalObj.IncomingObj.CommonObj             = new CommonViewModel();
         depositAndWithdrawalObj.IncomingObj.CommonObj.CreatedBy   = appUA.UserName;
         depositAndWithdrawalObj.IncomingObj.CommonObj.CreatedDate = DateTime.Now;
         depositAndWithdrawalObj.IncomingObj.CommonObj.UpdatedBy   = appUA.UserName;
         depositAndWithdrawalObj.IncomingObj.CommonObj.UpdatedDate = DateTime.Now;
         object OGC = _depositAndWithdrawalsBusiness.InsertUpdateIncomingCheque(Mapper.Map <IncomingChequesViewModel, IncomingCheques>(depositAndWithdrawalObj.IncomingObj));
         if (depositAndWithdrawalObj.IncomingObj.ID != null && depositAndWithdrawalObj.IncomingObj.ID != Guid.Empty)
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.UpdateSuccess, Records = OGC }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = OGC }));
         }
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #5
0
        public string InsertUpdateFollowUp(CustomerExpeditingListViewModel customerObj)
        {
            try
            {
                AppUA _appUA = Session["AppUA"] as AppUA;
                customerObj.followUpObj.commonObj = new CommonViewModel();
                SPAccounts.DataAccessObject.DTO.Common _comonObj = new SPAccounts.DataAccessObject.DTO.Common();
                customerObj.followUpObj.commonObj.CreatedBy   = _appUA.UserName;
                customerObj.followUpObj.commonObj.CreatedDate = _comonObj.GetCurrentDateTime();
                customerObj.followUpObj.commonObj.UpdatedDate = _comonObj.GetCurrentDateTime();
                customerObj.followUpObj.commonObj.UpdatedBy   = _appUA.UserName;
                FollowUpViewModel followupObj = Mapper.Map <FollowUp, FollowUpViewModel>(_paymentFollowupBusiness.InsertUpdateFollowUp(Mapper.Map <FollowUpViewModel, FollowUp>(customerObj.followUpObj)));

                if (customerObj.followUpObj.ID == Guid.Empty)
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Records = followupObj, Message = "Insertion successfull" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Records = followupObj, Message = "Updation successfull" }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
예제 #6
0
        public string InsertUpdateProductionQC(ProductionQCViewModel productionQCVM)
        {
            //object resultFromBusiness = null;

            try
            {
                AppUA appUA = Session["AppUA"] as AppUA;
                productionQCVM.PSASysCommon             = new PSASysCommonViewModel();
                productionQCVM.PSASysCommon.CreatedBy   = appUA.UserName;
                productionQCVM.PSASysCommon.CreatedDate = _pSASysCommon.GetCurrentDateTime();
                productionQCVM.PSASysCommon.UpdatedBy   = appUA.UserName;
                productionQCVM.PSASysCommon.UpdatedDate = _pSASysCommon.GetCurrentDateTime();
                object ResultFromJS   = JsonConvert.DeserializeObject(productionQCVM.DetailJSON);
                string ReadableFormat = JsonConvert.SerializeObject(ResultFromJS);
                productionQCVM.ProductionQCDetailList = JsonConvert.DeserializeObject <List <ProductionQCDetailViewModel> >(ReadableFormat);
                object result = _productionQCBusiness.InsertUpdateProductionQC(Mapper.Map <ProductionQCViewModel, ProductionQC>(productionQCVM));

                if (productionQCVM.ID == Guid.Empty)
                {
                    return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Insertion successfull" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Updation successfull" }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = _appConstant.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
            }
        }
        public string GetUndepositedCheque(string undepositedChequeAdvanceSearchObject)//FromDate, string ToDate)
        {
            try
            {
                //if (fromDate != "" ? Convert.ToDateTime(fromDate) > Convert.ToDateTime(chequeAdvanceSearchObj.ToDate) : false)
                //{
                //    throw new Exception("Date missmatch");
                //}
                AppUA appUA = Session["AppUA"] as AppUA;
                UndepositedChequeAdvanceSearch undepositedChequeAdvanceSearchObj = undepositedChequeAdvanceSearchObject != null?JsonConvert.DeserializeObject <UndepositedChequeAdvanceSearch>(undepositedChequeAdvanceSearchObject) : new UndepositedChequeAdvanceSearch();

                if (undepositedChequeAdvanceSearchObject == null)
                {
                    undepositedChequeAdvanceSearchObj.ToDate = appUA.DateTime.ToString("dd-MMM-yyyy");
                }
                List <DepositAndWithdrwalViewModel> unDepositedChequeList = Mapper.Map <List <DepositAndWithdrawals>, List <DepositAndWithdrwalViewModel> >(_depositAndWithdrawalsBusiness.GetUndepositedCheque(undepositedChequeAdvanceSearchObj));
                string MinDate              = unDepositedChequeList.Count != 0 ? Convert.ToDateTime((unDepositedChequeList.Min(X => Convert.ToDateTime(X.DateFormatted)))).ToString("dd-MMM-yyyy") : undepositedChequeAdvanceSearchObj.FromDate;
                var    totalAmount          = unDepositedChequeList.Where(amt => amt.TransactionType != "D").Sum(amt => amt.Amount);
                string totalAmountFormatted = _commonBusiness.ConvertCurrency(totalAmount, 2);
                return(JsonConvert.SerializeObject(new { Result = "OK", Records = unDepositedChequeList, FromDate = MinDate, totalAmount = totalAmountFormatted }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));//, FromDate = FromDate });
            }
        }
예제 #8
0
        public string InsertUpdateTaxType(TaxTypesViewModel _taxTypesObj)
        {
            try
            {
                object result = null;
                AppUA  appUA  = Session["AppUA"] as AppUA;
                _taxTypesObj.commonObj             = new CommonViewModel();
                _taxTypesObj.commonObj.CreatedBy   = appUA.UserName;
                _taxTypesObj.commonObj.CreatedDate = common.GetCurrentDateTime();
                _taxTypesObj.commonObj.UpdatedBy   = appUA.UserName;
                _taxTypesObj.commonObj.UpdatedDate = common.GetCurrentDateTime();
                if (!string.IsNullOrEmpty(_taxTypesObj.hdnCode))
                {
                    _taxTypesObj.Code = _taxTypesObj.hdnCode;
                }

                result = _taxTypeBusiness.InsertUpdateTaxType(Mapper.Map <TaxTypesViewModel, TaxTypes>(_taxTypesObj));
                return(JsonConvert.SerializeObject(new { Result = "OK", Records = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
예제 #9
0
 public string GetAllBanks()
 {
     try
     {
         List <BankViewModel> BankList    = Mapper.Map <List <Bank>, List <BankViewModel> >(_bankBusiness.GetAllBanks());
         Permission           _permission = Session["UserRights"] as Permission;
         string p = _permission.SubPermissionList.Where(li => li.Name == "ODLimit").First().AccessCode;
         foreach (var Item in BankList)
         {
             if (p.Contains("R") || p.Contains("W"))
             {
                 Item.ShowODLimit = true;
             }
             else
             {
                 Item.ShowODLimit = false;
             }
         }
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = BankList }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #10
0
        public string InsertUpdatePayments(SpecialInvPaymentsViewModel SpecialInvObj)
        {
            try
            {
                if (SpecialInvObj.specialDetailObj.PaidAmount == 0)
                {
                    throw new Exception("Please Enter Amount");
                }
                AppUA _appUA = Session["AppUA"] as AppUA;
                if (SpecialInvObj.hdfpaymentDetail != null)
                {
                    SpecialInvObj.specialList = JsonConvert.DeserializeObject <List <SpecialInvPaymentsDetailViewModel> >(SpecialInvObj.hdfpaymentDetail);
                }
                SpecialInvObj.commonObj             = new CommonViewModel();
                SpecialInvObj.commonObj.CreatedBy   = _appUA.UserName;
                SpecialInvObj.commonObj.CreatedDate = _appUA.DateTime;
                SpecialInvObj.commonObj.UpdatedBy   = _appUA.UserName;
                SpecialInvObj.commonObj.UpdatedDate = _appUA.DateTime;;
                SpecialInvPaymentsViewModel SPIN = Mapper.Map <SpecialInvPayments, SpecialInvPaymentsViewModel>(_SpecialInvPaymentsBusiness.InsertUpdateSpecialInvPayments(Mapper.Map <SpecialInvPaymentsViewModel, SpecialInvPayments>(SpecialInvObj)));

                if (SpecialInvObj.ID != null && SpecialInvObj.ID != Guid.Empty)
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.UpdateSuccess, Records = SPIN }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = SPIN }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
        public string InsertUpdateEmployeeCategory(EmployeeCategoryViewModel employeeCategoryViewModel)
        {
            object result = null;

            try
            {
                AppUA _appUA = Session["AppUA"] as AppUA;
                employeeCategoryViewModel.commonObj             = new CommonViewModel();
                employeeCategoryViewModel.commonObj.CreatedBy   = _appUA.UserName;
                employeeCategoryViewModel.commonObj.CreatedDate = _appUA.DateTime;
                employeeCategoryViewModel.commonObj.UpdatedBy   = employeeCategoryViewModel.commonObj.CreatedBy;
                employeeCategoryViewModel.commonObj.UpdatedDate = employeeCategoryViewModel.commonObj.CreatedDate;
                switch (employeeCategoryViewModel.Operation)
                {
                case "Insert":
                    result = _employeeBusiness.InsertEmployeeCategory(Mapper.Map <EmployeeCategoryViewModel, EmployeeCategory>(employeeCategoryViewModel));
                    break;

                case "Update":
                    result = _employeeBusiness.UpdateEmployeeCategory(Mapper.Map <EmployeeCategoryViewModel, EmployeeCategory>(employeeCategoryViewModel));
                    break;
                }

                return(JsonConvert.SerializeObject(new { Result = "OK", Record = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
예제 #12
0
        public string GetInvoicesAndSummary(string filter, string FromDate, string ToDate, string Supplier, string InvoiceType, string Company, string Status, string Search, string AccountCode, string EmpID)
        {
            try
            {
                AppUA appUA = Session["AppUA"] as AppUA;
                SupplierInvoiceBundleViewModel Result = new SupplierInvoiceBundleViewModel();
                DateTime?FDate = string.IsNullOrEmpty(FromDate) ? (DateTime?)null : DateTime.Parse(FromDate);
                DateTime?TDate = string.IsNullOrEmpty(ToDate) ? (DateTime?)null : DateTime.Parse(ToDate);
                Result.SupplierInvoiceSummary = Mapper.Map <SupplierInvoiceSummary, SupplierInvoiceSummaryViewModel>(_supplierInvoicesBusiness.GetSupplierInvoicesSummary(true));
                Result.SupplierInvoices       = Mapper.Map <List <SupplierInvoices>, List <SupplierInvoicesViewModel> >(_supplierInvoicesBusiness.GetAllSupplierInvoices(FDate, TDate, Supplier, InvoiceType, Company, Status, Search, AccountCode, EmpID));
                if (filter != null && filter == "OD")
                {
                    Result.SupplierInvoices = Result.SupplierInvoices.Where(m => m.PaymentDueDate < common.GetCurrentDateTime() && m.BalanceDue > 0).ToList();
                }
                else if (filter != null && filter == "OI")
                {
                    Result.SupplierInvoices = Result.SupplierInvoices.Where(m => m.PaymentDueDate >= common.GetCurrentDateTime() && m.BalanceDue > 0).ToList();
                }
                else if (filter != null && filter == "FP")
                {
                    Result.SupplierInvoices = Result.SupplierInvoices.Where(m => m.BalanceDue <= 0).ToList();
                }


                return(JsonConvert.SerializeObject(new { Result = "OK", Records = Result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
        public string InsertUpdateChartOfAccounts(ChartOfAccountsViewModel _chartOfAccountsObj)
        {
            try
            {
                object result = null;
                AppUA  _appUA = Session["AppUA"] as AppUA;
                _chartOfAccountsObj.CommonObj             = new CommonViewModel();
                _chartOfAccountsObj.CommonObj.CreatedBy   = _appUA.UserName;
                _chartOfAccountsObj.CommonObj.CreatedDate = _appUA.DateTime;
                _chartOfAccountsObj.CommonObj.UpdatedBy   = _appUA.UserName;
                _chartOfAccountsObj.CommonObj.UpdatedDate = _appUA.DateTime;
                if (!string.IsNullOrEmpty(_chartOfAccountsObj.hdnCode))
                {
                    _chartOfAccountsObj.Code = _chartOfAccountsObj.hdnCode;
                    _chartOfAccountsObj.Type = _chartOfAccountsObj.hdnType;
                }

                result = _chartOfAccountsBusiness.InsertUpdateChartOfAccounts(Mapper.Map <ChartOfAccountsViewModel, ChartOfAccounts>(_chartOfAccountsObj));
                return(JsonConvert.SerializeObject(new { Result = "OK", Records = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
예제 #14
0
 public string GetServiceCallChargeListByServiceCallID(Guid serviceCallID)
 {
     try
     {
         List <ServiceCallChargeViewModel> serviceCallChargeViewModelList = new List <ServiceCallChargeViewModel>();
         if (serviceCallID == Guid.Empty)
         {
             ServiceCallChargeViewModel serviceCallChargeVM = new ServiceCallChargeViewModel()
             {
                 ID            = Guid.Empty,
                 ServiceCallID = Guid.Empty,
                 ChargeAmount  = 0,
                 OtherCharge   = new OtherChargeViewModel()
                 {
                     Description = "",
                 },
                 TaxType = new TaxTypeViewModel()
                 {
                     ValueText = "",
                 }
             };
             serviceCallChargeViewModelList.Add(serviceCallChargeVM);
         }
         else
         {
             serviceCallChargeViewModelList = Mapper.Map <List <ServiceCallCharge>, List <ServiceCallChargeViewModel> >(_serviceCallBusiness.GetServiceCallChargeDetailListByServiceCallID(serviceCallID));
         }
         return(JsonConvert.SerializeObject(new { Status = "OK", Records = serviceCallChargeViewModelList, Message = "Success" }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConstant.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Records = "", Message = cm.Message }));
     }
 }
예제 #15
0
 public string SpecialPayments(CustomerInvoicesViewModel _customerInvoicesObj)
 {
     try
     {
         AppUA appUA = Session["AppUA"] as AppUA;
         _customerInvoicesObj.commonObj             = new CommonViewModel();
         _customerInvoicesObj.commonObj.CreatedBy   = appUA.UserName;
         _customerInvoicesObj.commonObj.CreatedDate = common.GetCurrentDateTime();
         _customerInvoicesObj.commonObj.UpdatedBy   = appUA.UserName;
         _customerInvoicesObj.commonObj.UpdatedDate = common.GetCurrentDateTime();
         CustomerInvoicesViewModel CIVM = Mapper.Map <CustomerInvoice, CustomerInvoicesViewModel>(_customerInvoicesBusiness.InsertUpdateSpecialPayments(Mapper.Map <CustomerInvoicesViewModel, CustomerInvoice>(_customerInvoicesObj), appUA));
         if ((_customerInvoicesObj.SpecialPayObj.ID != null) && (_customerInvoicesObj.SpecialPayObj.ID != Guid.Empty))
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.UpdateSuccess, Records = CIVM }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = CIVM }));
         }
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #16
0
        public string InsertUpdateDepartment(DepartmentViewModel departmentViewModel)
        {
            object result = null;

            try
            {
                AppUA _appUA = Session["AppUA"] as AppUA;
                departmentViewModel.commonObj             = new CommonViewModel();
                departmentViewModel.commonObj.CreatedBy   = _appUA.UserName;
                departmentViewModel.commonObj.CreatedDate = _appUA.DateTime;
                departmentViewModel.commonObj.UpdatedBy   = departmentViewModel.commonObj.CreatedBy;
                departmentViewModel.commonObj.UpdatedDate = departmentViewModel.commonObj.CreatedDate;
                switch (departmentViewModel.Operation)
                {
                case "Insert":
                    result = _departmentBusiness.InsertDepartment(Mapper.Map <DepartmentViewModel, Department>(departmentViewModel));
                    break;

                case "Update":
                    result = _departmentBusiness.UpdateDepartment(Mapper.Map <DepartmentViewModel, Department>(departmentViewModel));
                    break;
                }

                return(JsonConvert.SerializeObject(new { Result = "OK", Record = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
예제 #17
0
        public string InsertUpdateCompany(CompaniesViewModel _companyObj)
        {
            try
            {
                AppUA _appUA = Session["AppUA"] as AppUA;
                _companyObj.commonObj             = new CommonViewModel();
                _companyObj.commonObj.CreatedBy   = _appUA.UserName;
                _companyObj.commonObj.CreatedDate = _appUA.DateTime;
                _companyObj.commonObj.UpdatedBy   = _appUA.UserName;
                _companyObj.commonObj.UpdatedDate = _appUA.DateTime;

                CompaniesViewModel companyObj = Mapper.Map <Companies, CompaniesViewModel>(_companiesBusiness.InsertUpdateCompany(Mapper.Map <CompaniesViewModel, Companies>(_companyObj)));

                if (_companyObj.Code == "" || _companyObj.Code == null)
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Records = companyObj, Message = "Insertion successfull" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Result = "OK", Records = companyObj, Message = "Updation successfull" }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
예제 #18
0
 public string InsertUpdateInvoice(CustomerInvoicesViewModel _customerInvoicesObj)
 {
     try
     {
         if (_customerInvoicesObj.TotalInvoiceAmount == 0)
         {
             throw new Exception("Please Enter Amount");
         }
         if (_customerInvoicesObj.RefInvoice == null && _customerInvoicesObj.InvoiceType == "PB")
         {
             throw new Exception("Please Enter Reference Invoice");
         }
         AppUA appUA = Session["AppUA"] as AppUA;
         _customerInvoicesObj.commonObj             = new CommonViewModel();
         _customerInvoicesObj.commonObj.CreatedBy   = appUA.UserName;
         _customerInvoicesObj.commonObj.CreatedDate = common.GetCurrentDateTime();
         _customerInvoicesObj.commonObj.UpdatedBy   = appUA.UserName;
         _customerInvoicesObj.commonObj.UpdatedDate = common.GetCurrentDateTime();
         CustomerInvoicesViewModel CIVM = Mapper.Map <CustomerInvoice, CustomerInvoicesViewModel>(_customerInvoicesBusiness.InsertUpdateInvoice(Mapper.Map <CustomerInvoicesViewModel, CustomerInvoice>(_customerInvoicesObj), appUA));
         if (_customerInvoicesObj.ID != null && _customerInvoicesObj.ID != Guid.Empty)
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.UpdateSuccess, Records = CIVM }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = CIVM }));
         }
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #19
0
 public string GetAllOtherExpenseByApprovalStatus(string Status, string ExpenseDate, string DefaultDate)
 {
     try
     {
         List <OtherExpense> otherExpenseList = _otherExpenseBusiness.GetAllOtherExpenseByApprovalStatus((Status != "")?int.Parse(Status):0, ExpenseDate);
         if (!string.IsNullOrEmpty(DefaultDate))
         {
             if (DefaultDate == "0")
             {
                 otherExpenseList = otherExpenseList != null?otherExpenseList
                                    .ToList() : null;
             }
             else
             {
                 ExpenseDate      = DateTime.Now.AddDays(-int.Parse(DefaultDate)).ToString("dd-MMM-yyyy");
                 otherExpenseList = otherExpenseList != null?otherExpenseList
                                    .Where(o => DateTime.Parse(o.ExpenseDate).Date >= DateTime.Parse(ExpenseDate).Date && DateTime.Parse(o.ExpenseDate).Date <= DateTime.Now.Date)
                                    .ToList() : null;
             }
         }
         string sumAmount = _commonBusiness.ConvertCurrency(otherExpenseList != null ? otherExpenseList.Sum(o => o.Amount):decimal.Zero);
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = otherExpenseList, TotalAmount = sumAmount }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #20
0
        public string InsertUpdateEnquiryFollowup(EnquiryFollowupViewModel enquiryFollowupVM)
        {
            try
            {
                AppUA appUA = Session["AppUA"] as AppUA;
                enquiryFollowupVM.PSASysCommon             = new PSASysCommonViewModel();
                enquiryFollowupVM.PSASysCommon.CreatedBy   = appUA.UserName;
                enquiryFollowupVM.PSASysCommon.CreatedDate = _pSASysCommon.GetCurrentDateTime();
                enquiryFollowupVM.PSASysCommon.UpdatedBy   = appUA.UserName;
                enquiryFollowupVM.PSASysCommon.UpdatedDate = _pSASysCommon.GetCurrentDateTime();

                object result = _enquiryFollowupBusiness.InsertUpdateEnquiryFollowup(Mapper.Map <EnquiryFollowupViewModel, EnquiryFollowup>(enquiryFollowupVM));

                if (enquiryFollowupVM.ID == Guid.Empty)
                {
                    return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Insertion successfull" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Updation successfull" }));
                }
            }
            catch (Exception ex)
            {
                AppConstMessage cm = _appConstant.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
            }
        }
 public string InsertUpdateAccountHeadGroup(AccountHeadGroupViewModel accountHeadGroup)
 {
     try
     {
         AppUA appUA = Session["AppUA"] as AppUA;
         accountHeadGroup.commonObj             = new CommonViewModel();
         accountHeadGroup.commonObj.CreatedBy   = appUA.UserName;
         accountHeadGroup.commonObj.CreatedDate = common.GetCurrentDateTime();
         accountHeadGroup.commonObj.UpdatedBy   = appUA.UserName;
         accountHeadGroup.commonObj.UpdatedDate = common.GetCurrentDateTime();
         AccountHeadGroupViewModel CIVM = Mapper.Map <AccountHeadGroup, AccountHeadGroupViewModel>(_accountHeadGroupBusiness.InsertUpdateAccountHeadGroup(Mapper.Map <AccountHeadGroupViewModel, AccountHeadGroup>(accountHeadGroup), appUA));
         if (accountHeadGroup.ID != null && accountHeadGroup.ID != Guid.Empty)
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.UpdateSuccess, Records = CIVM }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = CIVM }));
         }
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #22
0
 public string GetMaximumReducibleAmount(string refNumber)
 {
     try
     {
         decimal amount = _otherExpenseBusiness.GetMaximumReducibleAmount(refNumber);
         return(JsonConvert.SerializeObject(new { Result = "OK", ReducibleAmount = amount }));
     }
     catch (Exception Ex)
     {
         AppConstMessage cm = c.GetMessage(Ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #23
0
 public string GetEmployeeCompanyDetails(string ID)
 {
     try
     {
         List <EmployeeViewModel> employeeViewModelList = Mapper.Map <List <Employee>, List <EmployeeViewModel> >(_otherExpenseBusiness.GetCompanybyEmployee(Guid.Parse(ID)));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = employeeViewModelList }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #24
0
 public string GetOpeningBalance(string OpeningDate)
 {
     try
     {
         OtherExpenseViewModel otherExpenseObj = Mapper.Map <OtherExpense, OtherExpenseViewModel>(_otherExpenseBusiness.GetOpeningBalance(OpeningDate));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = otherExpenseObj }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #25
0
 public string DeleteEnquiryFollowup(Guid id)
 {
     try
     {
         object result = _enquiryFollowupBusiness.DeleteEnquiryFollowup(id);
         return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Sucess" }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConstant.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
     }
 }
예제 #26
0
 public string GetEmployeeDetails(string ID)
 {
     try
     {
         EmployeeViewModel employeeObj = Mapper.Map <Employee, EmployeeViewModel>(_employeeBusiness.GetEmployeeDetails(ID != null && ID != "" ? Guid.Parse(ID) : Guid.Empty));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = employeeObj }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #27
0
 public string GetAllEmployees(string filter)
 {
     try
     {
         List <EmployeeViewModel> employeesList = Mapper.Map <List <Employee>, List <EmployeeViewModel> >(_employeeBusiness.GetAllEmployees(filter));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = employeesList }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #28
0
 public string GetAllSuppliers()
 {
     try
     {
         List <SuppliersViewModel> suppliersList = Mapper.Map <List <Supplier>, List <SuppliersViewModel> >(_SupplierBusiness.GetAllSuppliers());
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = suppliersList }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #29
0
 public string GetSupplierDetails(string ID)
 {
     try
     {
         SuppliersViewModel supplierObj = Mapper.Map <Supplier, SuppliersViewModel>(_SupplierBusiness.GetSupplierDetails(ID != null && ID != "" ? Guid.Parse(ID) : Guid.Empty));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = supplierObj }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #30
0
 public string DeleteTaxType(int code)
 {
     try
     {
         var result = _taxTypeBusiness.DeleteTaxType(code);
         return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Success" }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConst.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
     }
 }