public ActionResult Create(int Id, string No, DateTime JcDate, string Customer, string VehicleModel) { try { FillEmployee(); JobCardQC objJCQC = new JobCardQC(); objJCQC = JobCardQCRepo.GetJobCardDetails(Id, OrganizationId); objJCQC.JobCardQCRefNo = DatabaseCommonRepository.GetNextDocNo(17, OrganizationId); objJCQC.CurrentDate = System.DateTime.Today; objJCQC.JobCardQCParams = JobCardQCParamRepo.GetJobCardQCParamList(); return(View(objJCQC)); } catch (Exception ex) { string ErrorMessage = ex.Message.ToString(); if (ex.InnerException != null) { if (ex.InnerException.Message != null) { ErrorMessage = ErrorMessage + ex.InnerException.Message.ToString(); } } ViewData["Error"] = ErrorMessage; return(View("ShowError")); } }
public ActionResult Create() { var internalid = DatabaseCommonRepository.GetNextDocNo(1, OrganizationId); DropDowns(); //FillWrkDesc(); FillVehicle(); FillRateSettings(); SalesQuotation salesquotation = new SalesQuotation(); salesquotation.isProjectBased = false; salesquotation.QuotationDate = System.DateTime.Today; salesquotation.QuotationRefNo = internalid; salesquotation.PredictedClosingDate = System.DateTime.Today; salesquotation.QuotationValidToDate = System.DateTime.Today; salesquotation.ExpectedDeliveryDate = System.DateTime.Today; salesquotation.CurrencyId = new CurrencyRepository().GetCurrencyFrmOrganization(OrganizationId).CurrencyId; salesquotation.SalesQuotationItems = new List <SalesQuotationItem>(); salesquotation.SalesQuotationItems.Add(new SalesQuotationItem()); salesquotation.SalesQuotationItems[0].Quantity = 1; salesquotation.SalesQuotationItems[0].UnitName = "Nos"; salesquotation.Materials = new List <SalesQuotationMaterial>(); salesquotation.Materials.Add(new SalesQuotationMaterial()); ViewBag.SubmitAction = "Save"; return(View("CreateTransportation", salesquotation)); }
public ActionResult Save(int id = 0) { if (id != 0) { try { EmployeeDropdown(); List <PrintDescription> list = new List <PrintDescription>(); list.Add(new PrintDescription()); DeliveryChallan model = new DeliveryChallanRepository().GetDetailsFromJobCard(id, OrganizationId); if (model == null) { throw new NullReferenceException(); } model.JobCardId = id; model.DeliveryChallanRefNo = DatabaseCommonRepository.GetNextDocNo(18, OrganizationId); model.DeliveryChallanDate = DateTime.Now; model.TransportWarrantyExpiryDate = DateTime.Today.AddYears(1).AddDays(-1); model.ItemBatches = new DeliveryChallanRepository().GetSerialNos(id).ToList(); model.PrintDescriptions = list; return(View(model)); } catch (NullReferenceException) { TempData["error"] = "Could not find the requested Delivery Challan. Please try again."; } catch (Exception) { TempData["error"] = "Some error occurred. Please try again."; } } return(RedirectToAction("Index")); }
public ActionResult Save(int id = 0) { if (id != 0) { EmployeeDropdown(); string internalId = ""; try { internalId = DatabaseCommonRepository.GetNextDocNo(15, OrganizationId); } catch (NullReferenceException nx) { TempData["success"] = ""; TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message; } catch (Exception ex) { TempData["success"] = ""; TempData["error"] = "Some error occurred. Please try again.|" + ex.Message; } return(View(new VehicleInPass { SaleOrderItemId = id, VehicleInPassDate = DateTime.Now, VehicleInPassNo = internalId })); } return(RedirectToAction("Index")); }
public ActionResult Complete(int id = 0) { if (id == 0) { return(RedirectToAction("Index", "Home")); } ProjectCompletion model = new ProjectCompletionRepository().GetProjectDetails(id, OrganizationId); model.SaleOrderId = id; model.ProjectCompletionDate = DateTime.Today; model.ProjectWarrantyExpiryDate = DateTime.Today.AddYears(1).AddDays(-1); model.ProjectCompletionRefNo = DatabaseCommonRepository.GetNextDocNo(30, OrganizationId); model.ItemBatches = new ProjectCompletionRepository().GetSerialNos(id).ToList <ItemBatch>(); return(View(model)); //return View(new ProjectCompletion //{ // SaleOrderId = id, // ProjectCompletionDate = DateTime.Today, // ProjectWarrantyExpiryDate = DateTime.Today.AddYears(1).AddDays(-1), // ProjectCompletionRefNo = DatabaseCommonRepository.GetNextDocNo(30, OrganizationId), // ProjectName = model.ProjectName, // Location = model.Location, // CustomerName = model.CustomerName, // ItemBatches = new ProjectCompletionRepository().GetSerialNos(id).ToList<ItemBatch>() //}); }
public ActionResult CreateQuerySheet(string type) { FillDropdowns(); string internalId = ""; try { internalId = DatabaseCommonRepository.GetNextDocNo(5, OrganizationId); } catch (NullReferenceException nx) { TempData["success"] = ""; TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message; } catch (Exception ex) { TempData["success"] = ""; TempData["error"] = "Some error occurred. Please try again.|" + ex.Message; } QuerySheet qs = new QuerySheet(); qs.Type = type; qs.QuerySheetDate = DateTime.Now; var repo = new QuerySheetRepository(); qs.QuerySheetItems = new List <QuerySheetItem>(); qs.QuerySheetItems.Add(new QuerySheetItem()); qs.QuerySheetItems[0].ProjectRoomUnits = new List <QuerySheetUnit>(); qs.QuerySheetItems[0].ProjectRoomUnits.Add(new QuerySheetUnit()); qs.QuerySheetItems[0].ProjectRoomDoors = new List <QuerySheetDoor>(); qs.QuerySheetItems[0].ProjectRoomDoors.Add(new QuerySheetDoor()); qs.QuerySheetRefNo = internalId; return(View(qs)); }
public ActionResult Create() { string internalId = ""; try { internalId = DatabaseCommonRepository.GetNextDocNo(23, OrganizationId); JobCardDropdown(); ItemDropdown(); } catch (NullReferenceException nx) { TempData["success"] = ""; TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message; } catch (Exception ex) { TempData["success"] = ""; TempData["error"] = "Some error occurred. Please try again.|" + ex.Message; } List <ConsumptionItem> Items = new List <ConsumptionItem>(); Items.Add(new ConsumptionItem { SlNo = 1 }); return(View(new Consumption { ConsumptionItems = Items, ConsumptionDate = DateTime.Today, ConsumptionNo = internalId })); }
public ActionResult ServiceOrder(int id = 0)//ServiceEnquiryId is received here { try { if (id == 0) { TempData["error"] = "That was an invalid request. Please try again."; RedirectToAction("Index", "Home"); } FillDropDowns(); ServiceEnquiry model = new SaleOrderRepository().GetServiceEnquiryDetails(id, OrganizationId); model.SaleOrderRefNo = DatabaseCommonRepository.GetNextDocNo(42, OrganizationId); model.SaleOrderDate = DateTime.Today; model.isProjectBased = 1; model.isService = 1; model.IsConfirmed = 1; model.Items = new List <SaleOrderItem>(); model.Items.Add(new SaleOrderItem()); return(View("ServiceEnquiryProject", model)); } catch (InvalidOperationException) { TempData["error"] = "Requested data could not be found. Please try again."; } catch (Exception) { TempData["error"] = "Some error occurred. Please try again."; } return(RedirectToAction("PendingEnquiries", new { isProjectBased = 1 })); }
// GET: Item public ActionResult Create() { FillItemCategory(); FillUnit(); FillItem(); FillJobCardTaskMaster(); InitDropdown(); Item oItem = new Item(); oItem.PartNo = null; oItem.ItemName = null; oItem.ItemPrintName = null; oItem.ItemShortName = null; oItem.CommodityId = null; oItem.ItemCategoryId = 0; oItem.ItemGroupId = 0; oItem.ItemSubGroupId = 0; oItem.ItemUnitId = null; oItem.ExpiryDate = DateTime.Now; oItem.MinLevel = null; oItem.ReorderLevel = null; oItem.MaxLevel = null; oItem.StockRequired = false; oItem.BatchRequired = false; oItem.EvaporatorUnit = false; oItem.CondenserUnit = false; oItem.Door = false; oItem.ItemRefNo = "ITM/" + DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(Item).Name); oItem.ItemVsBom.Add(new WorkVsItem()); oItem.ItemVsTasks.Add(new WorkVsTask()); return(View("Create", oItem)); }
public ActionResult Create(IList <PendingPurchaseRequest> PendingPurchaseRequestItemsSelected) { FillDropdowns(); SupplyOrder supplyorder = new SupplyOrder(); supplyorder.SupplyOrderNo = DatabaseCommonRepository.GetNextDocNo(9, OrganizationId); SupplyOrderRepository rep = new SupplyOrderRepository(); if (PendingPurchaseRequestItemsSelected != null) { if (PendingPurchaseRequestItemsSelected.Count > 0) { List <int> selectedpurchaserequests = (from PendingPurchaseRequest p in PendingPurchaseRequestItemsSelected where p.Select select p.PurchaseRequestId).ToList <int>(); supplyorder.SupplyOrderItems = rep.GetPurchaseRequestItems(selectedpurchaserequests, OrganizationId); } } supplyorder.SupplyOrderDate = System.DateTime.Today; supplyorder.RequiredDate = System.DateTime.Today; supplyorder.CurrencyId = new CurrencyRepository().GetCurrencyFrmOrganization(OrganizationId).CurrencyId; return(View(supplyorder)); }
public ActionResult Create() { ViewBag.Title = "Create"; Company Company = new Company(); Company.cmpUsercode = "C/" + DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(Company).Name); return(View(Company)); }
public ActionResult Create() { string internalid = DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(VehicleModel).Name); return(View(new VehicleModel { VehicleModelRefNo = "VM/" + internalid })); }
public ActionResult Create() { string internalid = DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(CommissionAgent).Name); return(View(new CommissionAgent { CommissionAgentRefNo = "CA/" + internalid })); }
public ActionResult Create() { string internalid = DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(Stockpoint).Name); return(View(new Stockpoint { StockPointRefNo = "SP/" + internalid })); }
public ActionResult Create() { string internalid = DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(EmployeeCategory).Name); return(View(new EmployeeCategory { EmpCategoryRefNo = "EMPC/" + internalid })); }
public ActionResult Create(int?SaleOrderId, int?saleorderitem) { ItemDropdown(); ExceptFGItemDropdown(); WorkShopRequestRepository repo = new WorkShopRequestRepository(); WorkShopRequest model = repo.GetSaleOrderForWorkshopRequest(SaleOrderId ?? 0); model.SaleOrderItemId = saleorderitem ?? 0; model.WorkDescription = repo.GetCombinedWorkDescriptionSaleOrderForWorkshopRequest(SaleOrderId ?? 0).WorkDescription; List <WorkShopRequestItem> WSList = new List <WorkShopRequestItem>(); if (model.isProjectBased == 1) { WSList = repo.GetWorkShopRequestDataForProject(saleorderitem ?? 0); } else { WSList = repo.GetWorkShopRequestData(SaleOrderId ?? 0, saleorderitem ?? 0); } model.Items = new List <WorkShopRequestItem>(); //model.Isused = true; foreach (var item in WSList) { model.Items.Add(new WorkShopRequestItem { PartNo = item.PartNo, ItemName = item.ItemName, Quantity = item.Quantity, UnitName = item.UnitName, ItemId = item.ItemId, ActualQuantity = item.Quantity }); } string internalId = ""; try { if (model.isProjectBased == 0) { internalId = DatabaseCommonRepository.GetNextDocNo(19, OrganizationId); } else { internalId = DatabaseCommonRepository.GetNextDocNo(31, OrganizationId); } } catch (NullReferenceException nx) { TempData["success"] = ""; TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message; } catch (Exception ex) { TempData["success"] = ""; TempData["error"] = "Some error occurred. Please try again.|" + ex.Message; } model.WorkShopRequestRefNo = internalId; model.WorkShopRequestDate = System.DateTime.Today; model.RequiredDate = System.DateTime.Today; return(View(model)); }
public ActionResult Create() { FillCurrencySymbols(); string internalid = DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(Currency).Name); return(View(new Currency { CurrencyRefNo = "CUR/" + internalid })); }
public ActionResult Create() { ViewBag.Title = "Create"; QCParameters QC = new QCParameters(); QC.QCRefNo = "QC/" + DatabaseCommonRepository.GetNextReferenceNo(typeof(QCParameters).Name); dropdown(); return(View(QC)); }
public ActionResult Create() { FillItemGroup(); string internalid = DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(ItemSubGroup).Name); return(View(new ItemSubGroup { ItemSubGroupRefNo = "ISG/" + internalid })); }
public ActionResult Create() { FillDropdowns(); return(View(new StockTransfer { StockTransferDate = DateTime.Today, StockTransferRefNo = DatabaseCommonRepository.GetNextDocNo(29, OrganizationId), Items = TransferItemsGrid() })); }
public ActionResult Create() { ViewBag.Title = "Create"; SalesTarget Salestarget = new SalesTarget(); Salestarget.SalesTargetRefNo = "ST/" + DatabaseCommonRepository.GetNextReferenceNo(typeof(SalesTarget).Name);// new SalesTargetRepository().GetRefNo(Salestarget); dropdown(); return(View(Salestarget)); }
public ActionResult Create() { FillJobCard(); StockPointDropdown(); string internalid = DatabaseCommonRepository.GetNextDocNo(21, OrganizationId); return(View(new StockReturn { StockReturnDate = DateTime.Today, StockReturnRefNo = internalid })); }
public ActionResult Create(IList <PendingGRN> PendingGRNSelected) { FillAdditionDeduction(); FillCurrency(); PurchaseBill purchasebill = new PurchaseBill(); PurchaseBillRepository rep = new PurchaseBillRepository(); if (PendingGRNSelected != null) { if (PendingGRNSelected.Count > 0) { List <int> selectedgrn = (from PendingGRN p in PendingGRNSelected where p.Select select p.GRNId).ToList <int>(); purchasebill = rep.GetGRNHeadData(selectedgrn); purchasebill.Items = rep.GetGRNItems(selectedgrn); purchasebill.SupplyOrderNo = rep.GetSupplyOrderNos(selectedgrn).SupplyOrderNo; } } string internalId = ""; try { internalId = DatabaseCommonRepository.GetNextDocNo(32, OrganizationId); } catch (NullReferenceException nx) { TempData["success"] = ""; TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message; } catch (Exception ex) { TempData["success"] = ""; TempData["error"] = "Some error occurred. Please try again.|" + ex.Message; } try { purchasebill.PurchaseBillRefNo = internalId; purchasebill.Supplier = PendingGRNSelected[0].SupplierName; purchasebill.SupplierId = PendingGRNSelected[0].SupplierId; purchasebill.PurchaseBillDate = System.DateTime.Today; purchasebill.PurchaseBillDueDate = rep.GetBillDueDate(PendingGRNSelected[0].SupplierId).PurchaseBillDueDate; purchasebill.CurrencyId = new SupplierRepository().GetSupplierCurrency(PendingGRNSelected[0].SupplierId).CurrencyId; //purchasebill.CurrencyId = new CurrencyRepository().GetCurrencyFrmOrganization(OrganizationId).CurrencyId; return(View(purchasebill)); } catch (Exception) { TempData["error"] = "Some required data was missing. Please try again."; return(RedirectToAction("Index")); } }
public ActionResult Create(int?WorkShopRequestId) { PurchaseRequestRepository repo = new PurchaseRequestRepository(); PurchaseRequest model = repo.GetPurchaseRequestDetails(WorkShopRequestId ?? 0); var PRList = repo.GetPurchaseRequestItem(WorkShopRequestId ?? 0); model.items = new List <PurchaseRequestItem>(); foreach (var item in PRList) { var pritem = new PurchaseRequestItem { PartNo = item.PartNo, ItemName = item.ItemName, Quantity = item.Quantity, UnitName = item.UnitName, ItemId = item.ItemId, MinLevel = item.MinLevel, WRRequestQty = item.WRRequestQty, CurrentStock = item.CurrentStock, WRIssueQty = item.WRIssueQty, TotalQty = item.TotalQty, InTransitQty = item.InTransitQty, PendingPRQty = item.PendingPRQty, ShortorExcess = item.ShortorExcess }; model.items.Add(pritem); } string internalId = ""; try { internalId = DatabaseCommonRepository.GetNextDocNo(8, OrganizationId); } catch (NullReferenceException nx) { TempData["success"] = ""; TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message; } catch (Exception ex) { TempData["success"] = ""; TempData["error"] = "Some error occurred. Please try again.|" + ex.Message; } model.PurchaseRequestNo = internalId; model.PurchaseRequestDate = System.DateTime.Today; model.RequiredDate = System.DateTime.Today; model.OrganizationId = OrganizationId; model.CreatedDate = System.DateTime.Now; model.CreatedBy = UserID.ToString(); return(View(model)); }
public ActionResult Create(int Id) { JobCardRepository jcRepo = new JobCardRepository(); EmployeeRepository emRepo = new EmployeeRepository(); JobCard jc = jcRepo.GetDetailsById(Id, null); //FillTaks(jc.WorkDescriptionId); JobCardDailyActivity model = new JobCardDailyActivity(); if (jc.isProjectBased == 1) { model.JobCardDailyActivityRefNo = DatabaseCommonRepository.GetNextDocNo(38, OrganizationId); //FillTasks(); FillTasks(jc.isProjectBased); FillEmployees(); } else { model.JobCardDailyActivityRefNo = DatabaseCommonRepository.GetNextDocNo(27, OrganizationId); } model.CreatedDate = DateTime.Now; model.JobCardDailyActivityDate = DateTime.Now; model.isProjectBased = jc.isProjectBased; model.CustomerName = jc.CustomerName; if (model.isProjectBased == 0) { model.JobCardDailyActivityTask = new JobCardDailyActivityRepository().GetJobCardTasksForDailyActivity(Id, OrganizationId); } else { model.JobCardDailyActivityTask = new List <JobCardDailyActivityTask>(); model.JobCardDailyActivityTask.Add(new JobCardDailyActivityTask { TaskStartDate = model.JobCardDailyActivityDate, TaskEndDate = model.JobCardDailyActivityDate }); } //if (model.JobCardDailyActivityTask.Count > 0) //{ // foreach (var item in model.JobCardDailyActivityTask) // { // item.StartTime = "00:00"; item.EndTime = "00.00"; // } //} //model.JobCardDailyActivityTask = new List<JobCardDailyActivityTask>(); //model.JobCardDailyActivityTask.Add(new JobCardDailyActivityTask() { TaskStartDate = DateTime.Now, TaskEndDate = DateTime.Now}); Employee emp = emRepo.GetEmployee(jc.EmployeeId); model.EmployeeId = jc.EmployeeId; model.EmployeeName = emp.EmployeeName; model.JobCardNo = jc.JobCardNo; model.JobCardId = Id; ViewBag.isTxnPending = true; return(View(model)); }
public ActionResult Create() { ViewBag.Title = "Create"; Organization Organization = new Organization(); Organization.OrganizationRefNo = "ORG/" + DatabaseCommonRepository.GetNextRefNoWithNoUpdate(typeof(Organization).Name); dropdown(); FillCountryDropdown(); FillCompanyDropdown(); return(View(Organization)); }
public ActionResult ServiceEnquiryProject() { FillDropDowns(); return(View(new ServiceEnquiry { ServiceEnquiryRefNo = DatabaseCommonRepository.GetNextDocNo(41, OrganizationId), ServiceEnquiryDate = DateTime.Today, isProjectBased = 0, isService = 1, IsConfirmed = 0 })); }
public ActionResult Create() { FillDropdowns(); return(View(new SubAssembly { StockCreationDate = DateTime.Today, StockCreationRefNo = DatabaseCommonRepository.GetNextDocNo(26, OrganizationId), isSubAssembly = true, ConsumedItems = ConsumedItemsGrid(), FinishedGoods = FinishedGoodsGrid() })); }
public ActionResult Create() { FillDropdowns(); var model = new StockCreation { StockCreationDate = DateTime.Today, StockCreationRefNo = DatabaseCommonRepository.GetNextDocNo(25, OrganizationId), ConsumedItems = ConsumedItemsGrid(), FinishedGoods = FinishedGoodsGrid() }; return(View(model)); }
public ActionResult Issuance(int id = 0) { string referenceNo = DatabaseCommonRepository.GetNextDocNo(24, OrganizationId); FillDropdowns(); if (id == 0) { return(RedirectToAction("Pending")); } return(View(new StoreIssue { WorkShopRequestId = id, StoreIssueDate = DateTime.Today, StoreIssueRefNo = referenceNo })); }