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 })); } }
public string InserUpdateSubobject(AppSubobjectViewmodel AppObjectObj) { string result = ""; try { if (ModelState.IsValid) { AppUA _appUA = Session["AppUA"] as AppUA; AppObjectObj.commonDetails = new PSASysCommonViewModel(); AppObjectObj.commonDetails.CreatedBy = _appUA.UserName; AppObjectObj.commonDetails.CreatedDate = _appUA.LoginDateTime; AppObjectObj.commonDetails.UpdatedBy = AppObjectObj.commonDetails.CreatedBy; AppObjectObj.commonDetails.UpdatedDate = AppObjectObj.commonDetails.CreatedDate; AppSubobjectViewmodel res = Mapper.Map <AppSubobject, AppSubobjectViewmodel>(_appObjectBusiness.InsertUpdateSubObject(Mapper.Map <AppSubobjectViewmodel, AppSubobject>(AppObjectObj))); return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = res })); } } catch (Exception ex) { ConstMessage cm = c.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message })); } return(result); }
public string AddSubObjectAccessChanges(ManageSubObjectAccessViewModel manageSubObjectAccessViewModelObj) { try { AppUA _appUA = Session["AppUA"] as AppUA; //if (ModelState.IsValid) // { manageSubObjectAccessViewModelObj.commonObj = new PSASysCommonViewModel(); manageSubObjectAccessViewModelObj.commonObj.CreatedBy = _appUA.UserName; manageSubObjectAccessViewModelObj.commonObj.CreatedDate = _appUA.LoginDateTime; foreach (ManageSubObjectAccessViewModel ManageSubObjectAccessObj in manageSubObjectAccessViewModelObj.ManageSubObjectAccessList) { ManageSubObjectAccessObj.commonObj = new PSASysCommonViewModel(); ManageSubObjectAccessObj.commonObj = manageSubObjectAccessViewModelObj.commonObj; } ManageSubObjectAccessViewModel r = Mapper.Map <ManageSubObjectAccess, ManageSubObjectAccessViewModel>(_manageAccessBusiness.AddSubObjectAccessChanges(Mapper.Map <List <ManageSubObjectAccessViewModel>, List <ManageSubObjectAccess> >(manageSubObjectAccessViewModelObj.ManageSubObjectAccessList))); return(JsonConvert.SerializeObject(new { Result = "OK", Message = c.InsertSuccess, Records = r })); //} } catch (Exception ex) { ConstMessage cm = c.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message })); } }
public JsonResult GetAllApprovalHistory(DataTableAjaxPostModel model, DocumentApprovalAdvanceSearchViewModel documentApprovalAdvanceSearchVM) { AppUA appUA = Session["AppUA"] as AppUA; documentApprovalAdvanceSearchVM.LoginName = appUA.UserName; documentApprovalAdvanceSearchVM.DataTablePaging.Start = model.start; documentApprovalAdvanceSearchVM.DataTablePaging.Length = (documentApprovalAdvanceSearchVM.DataTablePaging.Length == 0 ? model.length : documentApprovalAdvanceSearchVM.DataTablePaging.Length); List <DocumentApprovalViewModel> documentApprovalList = Mapper.Map <List <DocumentApproval>, List <DocumentApprovalViewModel> >(_documentApprovalBusiness.GetAllApprovalHistory(Mapper.Map <DocumentApprovalAdvanceSearchViewModel, DocumentApprovalAdvanceSearch>(documentApprovalAdvanceSearchVM))); var settings = new JsonSerializerSettings { Formatting = Formatting.None }; //if (documentApprovalAdvanceSearchVM.DataTablePaging.Length == -1) //{ // int totalResult = documentApprovalList.Count != 0 ? documentApprovalList[0].TotalCount : 0; // int filteredResult = documentApprovalList.Count != 0 ? documentApprovalList[0].FilteredCount : 0; // documentApprovalList = documentApprovalList.Skip(0).Take(filteredResult > 10000 ? 10000 : filteredResult).ToList(); //} return(Json(new { draw = model.draw, recordsTotal = documentApprovalList.Count != 0 ? documentApprovalList[0].TotalCount : 0, recordsFiltered = documentApprovalList.Count != 0 ? documentApprovalList[0].FilteredCount : 0, data = documentApprovalList })); }
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 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 }); } }
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 })); } }
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 })); } }
public ActionResult ChangeButtonStyle(string ActionType) { //Permission _permission = Session["UserRights"] as Permission; AppUA appUA = Session["AppUA"] as AppUA; Permission _permission = _pSASysCommon.GetSecurityCode(appUA.UserName, "UserInBranch"); ToolboxViewModel ToolboxViewModelObj = new ToolboxViewModel(); switch (ActionType) { case "Default": if ((_permission.SubPermissionList.Count > 0 ? _permission.SubPermissionList.First(s => s.Name == "ButtonSave").AccessCode : string.Empty).Contains("R")) { ToolboxViewModelObj.savebtn.Visible = true; } ToolboxViewModelObj.savebtn.Title = "Save"; ToolboxViewModelObj.savebtn.Text = "Save"; ToolboxViewModelObj.savebtn.Event = "SaveChanges()"; ToolboxViewModelObj.backbtn.Visible = true; ToolboxViewModelObj.backbtn.Text = "Back"; ToolboxViewModelObj.backbtn.Title = "Back to list"; ToolboxViewModelObj.backbtn.Event = "goHome()"; break; default: return(Content("Nochange")); } return(PartialView("ToolboxView", ToolboxViewModelObj)); }
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 })); } }
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 ActionResult Index() { AppUA _appUA = Session["AppUA"] as AppUA; if (("," + _appUA.RolesCSV + ",").Contains(",SAdmin,") || _appUA.RolesCSV.Contains("CEO")) { return(RedirectToAdminDashboard()); } else { LoggedUserName = _appUA.UserName; DynamicUIViewModel dUIObj = new DynamicUIViewModel(); List <Menu> menulist = _dynamicUIBusiness.GetAllMenues(); dUIObj.MenuViewModelList = Mapper.Map <List <Menu>, List <MenuViewModel> >(menulist); foreach (MenuViewModel item in dUIObj.MenuViewModelList) { if (item.SecurityObject != null) { Permission _permission = _userBusiness.GetSecurityCode(LoggedUserName, item.SecurityObject); if (_permission.AccessCode.Contains('R')) { item.HasAccess = true; } } } return(View(dUIObj)); } }
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 })); } }
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 })); } }
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 })); } }
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 })); } }
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 })); } }
public ActionResult BankBalance() { AppUA _appUA = Session["AppUA"] as AppUA; ViewBag.Currentdate = _appUA.DateTime.ToString("dd-MMM-yyyy"); return(View()); }
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 ActionResult ChangeButtonStyle(string actionType) { AppUA appUA = Session["AppUA"] as AppUA; Permission permission = _psaSysCommon.GetSecurityCode(appUA.UserName, "TaxType"); ToolboxViewModel toolboxVM = new ToolboxViewModel(); switch (actionType) { case "List": toolboxVM.addbtn.Visible = true; toolboxVM.addbtn.Text = "Add"; toolboxVM.addbtn.Title = "Add New"; toolboxVM.addbtn.Event = "AddTaxTypeMaster('MSTR')"; //----added for reset button--------------- toolboxVM.resetbtn.Visible = true; toolboxVM.resetbtn.Text = "Reset"; toolboxVM.resetbtn.Title = "Reset All"; toolboxVM.resetbtn.Event = "ResetTaxTypeList();"; //----added for export button-------------- toolboxVM.ExportBtn.Visible = true; toolboxVM.ExportBtn.Text = "Export"; toolboxVM.ExportBtn.Title = "Export"; toolboxVM.ExportBtn.Event = "ExportTaxTypeData();"; //--------------------------------------- break; default: return(Content("Nochange")); } toolboxVM = _tool.SetToolbarAccess(toolboxVM, permission); return(PartialView("ToolboxView", toolboxVM)); }
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 })); } }
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 })); } }
public ActionResult EnquiryForm(Guid id) { EnquiryViewModel enquiryVM = null; try { if (id != Guid.Empty) { enquiryVM = Mapper.Map <Enquiry, EnquiryViewModel>(_enquiryBusiness.GetEnquiry(id)); enquiryVM.IsUpdate = true; AppUA appUA = Session["AppUA"] as AppUA; enquiryVM.IsDocLocked = enquiryVM.DocumentOwners.Contains(appUA.UserName); enquiryVM.Customer = new CustomerViewModel { CompanyName = enquiryVM.Customer.CompanyName, Titles = new TitlesViewModel() { TitlesSelectList = _customerBusiness.GetTitleSelectList(), }, }; enquiryVM.Currency = new CurrencyViewModel(); } else { enquiryVM = new EnquiryViewModel(); enquiryVM.IsUpdate = false; enquiryVM.ID = Guid.Empty; enquiryVM.DocumentStatus = new DocumentStatusViewModel(); enquiryVM.DocumentStatus.Description = "-"; enquiryVM.Branch = new BranchViewModel(); enquiryVM.Branch.Description = "-"; enquiryVM.IsDocLocked = false; enquiryVM.CurrencyRate = 1; enquiryVM.CurrencyCode = "INR"; enquiryVM.Customer = new CustomerViewModel { //CompanyName = "-", Titles = new TitlesViewModel() { TitlesSelectList = _customerBusiness.GetTitleSelectList(), }, }; } enquiryVM.EnquiryGrade = new EnquiryGradeViewModel() { EnquiryGradeSelectList = _enquiryGradeBusiness.GetEnquiryGradeSelectList() }; enquiryVM.Currency = new CurrencyViewModel() { CurrencyList = Mapper.Map <List <Currency>, List <CurrencyViewModel> >(_currencyBusiness.GetCurrencyForSelectList()) }; } catch (Exception ex) { throw ex; } return(PartialView("_EnquiryForm", enquiryVM)); }
public ActionResult RecentDocument() { RecentDocumentViewModel recentDocument = new RecentDocumentViewModel(); AppUA appUA = Session["AppUA"] as AppUA; recentDocument.RecentDocumentList = Mapper.Map <List <RecentDocument>, List <RecentDocumentViewModel> >(_commonBusiness.GetRecentDocument(appUA.UserName)); return(PartialView("_RecentDocument", recentDocument)); }
public ActionResult ChangeButtonStyle(string actionType) { ToolboxViewModel toolboxVM = new ToolboxViewModel(); AppUA appUA = Session["AppUA"] as AppUA; Permission permission = _pSASysCommon.GetSecurityCode(appUA.UserName, "DocumentApproval"); switch (actionType) { case "List": //----added for reset button--------------- toolboxVM.resetbtn.Visible = true; toolboxVM.resetbtn.Text = "Reset"; toolboxVM.resetbtn.Title = "Reset All"; toolboxVM.resetbtn.Event = "ResetPendingDocList();"; //----added for export button-------------- toolboxVM.ExportBtn.Visible = true; toolboxVM.ExportBtn.Text = "Export"; toolboxVM.ExportBtn.Title = "Export"; toolboxVM.ExportBtn.Event = "ExportPendingDocs();"; //--------------------------------------- break; case "Back": toolboxVM.CloseBtn.Visible = true; toolboxVM.CloseBtn.Text = "Close"; toolboxVM.CloseBtn.Title = "Close"; toolboxVM.CloseBtn.Event = "Close();"; //need to change function to rebind table break; case "Close": toolboxVM.CloseBtn.Visible = true; toolboxVM.CloseBtn.Text = "Close"; toolboxVM.CloseBtn.Title = "Close"; toolboxVM.CloseBtn.Event = "closeNav();"; break; case "ApprovalHistory": toolboxVM.resetbtn.Visible = true; toolboxVM.resetbtn.Text = "Reset"; toolboxVM.resetbtn.Title = "Reset All"; toolboxVM.resetbtn.Event = "ResetApprovalHistory();"; //--------------------------------------- toolboxVM.ExportBtn.Visible = true; toolboxVM.ExportBtn.Text = "Export"; toolboxVM.ExportBtn.Title = "Export"; toolboxVM.ExportBtn.Event = "ExportApprovalHistory();"; break; default: return(Content("Nochange")); } toolboxVM = _tool.SetToolbarAccess(toolboxVM, permission); return(PartialView("ToolboxView", toolboxVM)); }
public ActionResult BranchSelectList(string required, bool?disabled) { ViewBag.IsRequired = required; ViewBag.IsDisabled = disabled; ViewBag.propertydisable = disabled == null ? false : disabled; AppUA appUA = Session["AppUA"] as AppUA; BranchViewModel branchVM = new BranchViewModel(); branchVM.BranchList = _branchBusiness.GetBranchForSelectList(appUA.UserName); return(PartialView("_BranchSelectList", branchVM)); }
public ActionResult ServiceCallForm(Guid id) { ServiceCallViewModel serviceCallVM = null; try { if (id != Guid.Empty) { serviceCallVM = Mapper.Map <ServiceCall, ServiceCallViewModel>(_serviceCallBusiness.GetServiceCall(id)); serviceCallVM.IsUpdate = true; AppUA appUA = Session["AppUA"] as AppUA; serviceCallVM.IsDocLocked = serviceCallVM.DocumentOwners.Contains(appUA.UserName); serviceCallVM.Customer = new CustomerViewModel() { CompanyName = serviceCallVM.Customer.CompanyName, Titles = new TitlesViewModel() { TitlesSelectList = _customerBusiness.GetTitleSelectList(), }, }; serviceCallVM.Currency = new CurrencyViewModel(); } else //(id == Guid.Empty) { serviceCallVM = new ServiceCallViewModel(); serviceCallVM.IsUpdate = false; serviceCallVM.ID = Guid.Empty; serviceCallVM.DocumentStatus = new DocumentStatusViewModel(); serviceCallVM.DocumentStatus.Description = "-"; serviceCallVM.Branch = new BranchViewModel(); serviceCallVM.Branch.Description = "-"; serviceCallVM.Customer = new CustomerViewModel { //CompanyName = serviceCallVM.Customer.CompanyName, Titles = new TitlesViewModel() { TitlesSelectList = _customerBusiness.GetTitleSelectList(), }, }; serviceCallVM.CurrencyCode = "INR"; serviceCallVM.CurrencyRate = 1; serviceCallVM.Currency = new CurrencyViewModel() { CurrencyList = Mapper.Map <List <Currency>, List <CurrencyViewModel> >(_currencyBusiness.GetCurrencyForSelectList()) }; } } catch (Exception ex) { throw ex; } return(PartialView("_ServiceCallForm", serviceCallVM)); }
public string InsertUpdateOtherExpense(OtherExpenseViewModel otherExpenseViewModel) { if (ModelState.IsValid) { try { //removiing combined code int len = otherExpenseViewModel.AccountCode.IndexOf(':'); otherExpenseViewModel.AccountCode = otherExpenseViewModel.AccountCode.Remove(len); // AppUA appUA = Session["AppUA"] as AppUA; otherExpenseViewModel.commonObj = new CommonViewModel(); SPAccounts.DataAccessObject.DTO.Common common = new SPAccounts.DataAccessObject.DTO.Common(); otherExpenseViewModel.commonObj.CreatedBy = appUA.UserName; otherExpenseViewModel.commonObj.CreatedDate = common.GetCurrentDateTime(); otherExpenseViewModel.commonObj.UpdatedBy = appUA.UserName; otherExpenseViewModel.commonObj.UpdatedDate = common.GetCurrentDateTime(); OtherExpenseViewModel otherExpenseVM = null; switch (otherExpenseViewModel.ID == Guid.Empty) { //INSERT case true: otherExpenseVM = Mapper.Map <OtherExpense, OtherExpenseViewModel>(_otherExpenseBusiness.InsertOtherExpense(Mapper.Map <OtherExpenseViewModel, OtherExpense>(otherExpenseViewModel))); return(JsonConvert.SerializeObject(new { Result = "OK", Record = otherExpenseVM })); default: //Getting UA otherExpenseVM = Mapper.Map <OtherExpense, OtherExpenseViewModel>(_otherExpenseBusiness.UpdateOtherExpense(Mapper.Map <OtherExpenseViewModel, OtherExpense>(otherExpenseViewModel))); return(JsonConvert.SerializeObject(new { Result = "OK", Record = otherExpenseVM })); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = ex.Message })); } } //Model state errror else { List <string> modelErrors = new List <string>(); foreach (var modelState in ModelState.Values) { foreach (var modelError in modelState.Errors) { modelErrors.Add(modelError.ErrorMessage); } } return(JsonConvert.SerializeObject(new { Result = "VALIDATION", Message = string.Join(",", modelErrors) })); } }
public ActionResult ProductionQCForm(Guid id, Guid?productionOrderID) { ProductionQCViewModel productionQCVM = null; try { if (id != Guid.Empty) { productionQCVM = Mapper.Map <ProductionQC, ProductionQCViewModel>(_productionQCBusiness.GetProductionQC(id)); productionQCVM.IsUpdate = true; productionQCVM.ProdOrderSelectList = _productionOrderBusiness.GetProductionOrderForSelectList(productionOrderID); AppUA appUA = Session["AppUA"] as AppUA; productionQCVM.IsDocLocked = productionQCVM.DocumentOwners.Contains(appUA.UserName); } else if (id == Guid.Empty && productionOrderID == null) { productionQCVM = new ProductionQCViewModel(); productionQCVM.IsUpdate = false; productionQCVM.ID = Guid.Empty; productionQCVM.ProdOrderID = null; productionQCVM.ProdOrderSelectList = new List <SelectListItem>(); productionQCVM.DocumentStatus = new DocumentStatusViewModel() { Description = "-", }; //productionQCVM.Customer = new CustomerViewModel(); //productionQCVM.Customer.CompanyName = "-"; productionQCVM.IsDocLocked = false; } else if (id == Guid.Empty && productionOrderID != null) { ProductionOrderViewModel productioOrderVM = Mapper.Map <ProductionOrder, ProductionOrderViewModel>(_productionOrderBusiness.GetProductionOrder((Guid)productionOrderID)); productionQCVM = new ProductionQCViewModel(); productionQCVM.IsUpdate = false; productionQCVM.ID = Guid.Empty; productionQCVM.ProdOrderSelectList = _productionOrderBusiness.GetProductionOrderForSelectList(productionOrderID); productionQCVM.ProdOrderID = productionOrderID; productionQCVM.CustomerID = productioOrderVM.CustomerID; productionQCVM.DocumentStatus = new DocumentStatusViewModel() { Description = "-", }; productionQCVM.Customer = productioOrderVM.Customer; productionQCVM.IsDocLocked = false; } } catch (Exception ex) { throw ex; } return(PartialView("_ProductionQCForm", productionQCVM)); }