Exemple #1
0
 public async Task <IActionResult> AddEditPaymentDetails(int id, [Bind("Amount, InvoiceNumber, CardEndingNumber,  CardType, EDCId, EDCTranscationId, OnDate, StoreId")] EDCTranscation eDC)
 {
     if (ModelState.IsValid)
     {
         //Insert
         if (eDC.EDCTranscationId == 0)
         {
             db.Add(eDC);
             await db.SaveChangesAsync();
         }
         //Update
         else
         {
             try
             {
                 db.Update(eDC);
                 await db.SaveChangesAsync();
             }
             catch (DbUpdateConcurrencyException)
             {
                 if (!CardTranscationExists(eDC.EDCTranscationId))
                 {
                     return(NotFound());
                 }
                 else
                 {
                     throw;
                 }
             }
         }
         return(Json(new { isValid = true, html = Helper.RenderRazorViewToString(this, "Index", db.CardTranscations.ToList()) }));
     }
     return(Json(new { isValid = false, html = Helper.RenderRazorViewToString(this, "AddEditPaymentDetails", eDC) }));
     //TODO: here we need to refresh index page update/add opertation if required other wise no need call this function just pass is valid or not.
 }
        public async Task <IActionResult> Create([Bind("ExpenseId,Particulars,PartyName,EmployeeId,OnDate,PayMode,BankAccountId,PaymentDetails,Amount,Remarks,PartyId,LedgerEnteryId,IsCash,StoreId,UserId,EntryStatus")] Expense expense)
        {
            if (ModelState.IsValid)
            {
                if (expense.PayMode == PaymentMode.Cash)
                {
                    expense.BankAccountId = null;
                }
                _context.Add(expense);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankAccountId"] = new SelectList(_context.BankAccounts, "BankAccountId", "Account", expense.BankAccountId);
            ViewData["EmployeeId"]    = new SelectList(_context.Employees, "EmployeeId", "StaffName", expense.EmployeeId);
            ViewData["PartyId"]       = new SelectList(_context.Parties.OrderBy(c => c.PartyName), "PartyId", "PartyName", expense.PartyId);
            ViewData["StoreId"]       = ActiveSession.GetActiveSession(HttpContext.Session, HttpContext.Response, _returnUrl);

            Console.WriteLine($"StoreId+{expense.StoreId}\tEnt {expense.EntryStatus},\t us {expense.UserId}, \taa=" + ModelState.IsValid);
            foreach (var modelState in ViewData.ModelState.Values)
            {
                foreach (ModelError error in modelState.Errors)
                {
                    Console.WriteLine(error.ErrorMessage);
                }
            }
            return(View(expense));
        }
        public async Task <IActionResult> Create([Bind("AttendanceId,EmployeeId,AttDate,EntryTime,Status,Remarks,IsTailoring,StoreId,UserId,EntryStatus,IsReadOnly")] Attendance attendance)
        {
            if (ModelState.IsValid)
            {
                if (DBValidation.AttendanceDuplicateCheck(_context, attendance))
                {
                    ViewBag.ErrorMessage   = "Attendance already added!. Possible duplicate entry.";
                    ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "StaffName", attendance.EmployeeId);
                    StoreInfo storeInfo1 = PostLogin.ReadStoreInfo(HttpContext.Session);
                    ViewData["StoreId"]  = storeInfo1.StoreId;
                    ViewData["UserName"] = storeInfo1.UserName;
                    return(View(attendance));
                }
                _context.Add(attendance);
                await _context.SaveChangesAsync();

                new PayrollManager().ONInsertOrUpdate(_context, attendance, false, false);
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "StaffName", attendance.EmployeeId);
            StoreInfo storeInfo = PostLogin.ReadStoreInfo(HttpContext.Session);

            ViewData["StoreId"]  = storeInfo.StoreId;
            ViewData["UserName"] = storeInfo.UserName;
            return(View(attendance));
        }
Exemple #4
0
        public async Task <IActionResult> Create([Bind("OnlineVendorId,VendorName,OnDate,IsActive,Remark,OffDate,Reason")] OnlineVendor onlineVendor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(onlineVendor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(onlineVendor));
        }
Exemple #5
0
        public async Task <IActionResult> Create([Bind("LedgerTypeId,LedgerNameType,Category,Remark")] LedgerType ledgerType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ledgerType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(ledgerType));
        }
Exemple #6
0
        public async Task <IActionResult> Create([Bind("SalesmanInfoId,SalesmanName,TotalSale,CurrentYear,CurrentMonth,LastMonth,LastYear,TotalBillCount,Average")] SalesmanInfo salesmanInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salesmanInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(salesmanInfo));
        }
Exemple #7
0
        public async Task <IActionResult> Create([Bind("StoreId,StoreCode,StoreName,Address,City,PinCode,PhoneNo,StoreManagerName,StoreManagerPhoneNo,PanNo,GSTNO,NoOfEmployees,OpeningDate,ClosingDate,Status")] Store store)
        {
            if (ModelState.IsValid)
            {
                _context.Add(store);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(store));
        }
        public async Task <IActionResult> Create([Bind("PurchaseTaxTypeId,TaxName,TaxType,CompositeRate")] PurchaseTaxType purchaseTaxType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchaseTaxType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(purchaseTaxType));
        }
Exemple #9
0
        public async Task <IActionResult> Create([Bind("CustomerId,FirstName,LastName,Age,DateOfBirth,City,MobileNo,Gender,NoOfBills,TotalAmount,CreatedDate")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(customer));
        }
Exemple #10
0
        public async Task <IActionResult> Create([Bind("FirstName,LastName,IsEmployee,EmployeeId,IsWorking,Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] AppUser appUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(appUser));
        }
        public async Task <IActionResult> Create([Bind("ContactId,FirstName,LastName,MobileNo,PhoneNo,EMailAddress,Remarks")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(contact));
        }
        public async Task <IActionResult> Create([Bind("TranscationModeId,Transcation")] TranscationMode transcationMode)
        {
            if (ModelState.IsValid)
            {
                _context.Add(transcationMode);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(transcationMode));
        }
        public async Task <IActionResult> Create([Bind("CashInHandId,CIHDate,OpenningBalance,ClosingBalance,CashIn,CashOut,StoreId")] CashInHand cashInHand)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cashInHand);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreId", cashInHand.StoreId);
            return(View(cashInHand));
        }
Exemple #14
0
        public static int CreateLedgerMaster(eStoreDbContext db, Party party)
        {
            LedgerMaster master = new LedgerMaster
            {
                CreatingDate = DateTime.Today,
                PartyId      = party.PartyId,
                LedgerTypeId = party.LedgerTypeId
            };

            db.Add(master);
            return(db.SaveChanges());
        }
Exemple #15
0
        public async Task <IActionResult> Create([Bind("ElectricityConnectionId,LocationName,ConnectioName,City,State,PinCode,ConsumerNumber,ConusumerId,Connection,ConnectinDate,DisconnectionDate,KVLoad,OwnedMetter,TotalConnectionCharges,SecurityDeposit,Remarks,StoreId,UserId,IsReadOnly")] ElectricityConnection electricityConnection)
        {
            if (ModelState.IsValid)
            {
                _context.Add(electricityConnection);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", electricityConnection.StoreId);
            return(View(electricityConnection));
        }
Exemple #16
0
        public async Task <IActionResult> Create([Bind("StoreHolidayId,OnDate,Reason,Remarks,ApprovedBy,StoreId,UserId,EntryStatus,IsReadOnly")] StoreHoliday storeHoliday)
        {
            if (ModelState.IsValid)
            {
                _context.Add(storeHoliday);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreId", storeHoliday.StoreId);
            return(PartialView(storeHoliday));
        }
        public async Task <IActionResult> Create([Bind("RentedLocationId,PlaceName,Address,OnDate,VacatedDate,City,OwnerName,MobileNo,RentAmount,AdvanceAmount,IsRented,RentType,StoreId,UserId,IsReadOnly")] RentedLocation rentedLocation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rentedLocation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", rentedLocation.StoreId);
            return(PartialView(rentedLocation));
        }
Exemple #18
0
        public async Task <IActionResult> Create([Bind("DuesListId,Amount,IsRecovered,RecoveryDate,DailySaleId,IsPartialRecovery,StoreId,UserId")] DuesList duesList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(duesList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DailySaleId"] = new SelectList(_context.DailySales, "DailySaleId", "InvNo", duesList.DailySaleId);
            // ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", duesList.StoreId);
            return(PartialView(duesList));
        }
        public async Task <IActionResult> Create([Bind("DueRecoverdId,PaidDate,DuesListId,AmountPaid,IsPartialPayment,Modes,Remarks,StoreId,UserId")] DueRecoverd dueRecoverd)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dueRecoverd);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DuesListId"] = new SelectList(_context.DuesLists.Include(c => c.DailySale), "DuesListId", "InvNo", dueRecoverd.DuesListId);
            //ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", dueRecoverd.StoreId);
            return(View(dueRecoverd));
        }
Exemple #20
0
        public async Task <IActionResult> Create([Bind("RentId,RentedLocationId,RentType,OnDate,Period,Amount,Mode,PaymentDetails,Remarks,StoreId,UserId,EntryStatus,IsReadOnly")] Rent rent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rent);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RentedLocationId"] = new SelectList(_context.RentedLocations, "RentedLocationId", "PlaceName", rent.RentedLocationId);
            ViewData["StoreId"]          = new SelectList(_context.Stores, "StoreId", "StoreName", rent.StoreId);
            return(PartialView(rent));
        }
Exemple #21
0
        public async Task <IActionResult> Create([Bind("TalioringBookingId,BookingDate,CustName,DeliveryDate,TryDate,BookingSlipNo,TotalAmount,TotalQty,ShirtQty,ShirtPrice,PantQty,PantPrice,CoatQty,CoatPrice,KurtaQty,KurtaPrice,BundiQty,BundiPrice,Others,OthersPrice,IsDelivered,StoreId,UserId,EntryStatus,IsReadOnly")] TalioringBooking talioringBooking)
        {
            if (ModelState.IsValid)
            {
                _context.Add(talioringBooking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewBag.StoreID     = ActiveSession.GetActiveSession(HttpContext.Session, HttpContext.Response, "/Identity/Account/Login?ReturnUrl=/Tailoring/TalioringBookings");
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", talioringBooking.StoreId);
            return(View(talioringBooking));
        }
        public async Task <IActionResult> Create([Bind("EletricityBillId,ElectricityConnectionId,BillNumber,BillDate,MeterReadingDate,CurrentMeterReading,TotalUnit,CurrentAmount,ArrearAmount,NetDemand,StoreId,UserId,IsReadOnly")] EletricityBill eletricityBill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eletricityBill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ElectricityConnectionId"] = new SelectList(_context.ElectricityConnections, "ElectricityConnectionId", "ConnectioName", eletricityBill.ElectricityConnectionId);
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", eletricityBill.StoreId);
            return(View(eletricityBill));
        }
        public async Task <IActionResult> Create([Bind("OnlineSaleId,SaleDate,InvNo,Amount,VoyagerInvoiceNo,VoygerDate,VoyagerAmount,ShippingMode,VendorFee,ProfitValue,Remarks,OnlineVendorId")] OnlineSale OnlineSales)
        {
            if (ModelState.IsValid)
            {
                OnlineSales.UserId = User.Identity.Name;
                _context.Add(OnlineSales);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OnlineVendorId"] = new SelectList(_context.Set <OnlineVendor>(), "OnlineVendorId", "OnlineVendorId", OnlineSales.OnlineVendorId);
            return(PartialView(OnlineSales));
        }
Exemple #24
0
        public async Task <IActionResult> Create([Bind("PartyId,PartyName,OpenningDate,OpenningBalance,Address,PANNo,GSTNo,LedgerTypeId")] Party party)
        {
            if (ModelState.IsValid)
            {
                _context.Add(party);
                await _context.SaveChangesAsync();

                AccountOperation.CreateLedgerMaster(_context, party);
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LedgerTypeId"] = new SelectList(_context.LedgerTypes, "LedgerTypeId", "LedgerNameType", party.LedgerTypeId);
            return(PartialView(party));
        }
Exemple #25
0
        public async Task <IActionResult> Create([Bind("EBillPaymentId,EletricityBillId,PaymentDate,Amount,Mode,PaymentDetails,Remarks,IsPartialPayment,IsBillCleared,StoreId,UserId,EntryStatus,IsReadOnly")] EBillPayment eBillPayment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eBillPayment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EletricityBillId"] = new SelectList(_context.EletricityBills, "EletricityBillId", "BillNumber", eBillPayment.EletricityBillId);
            ViewData["StoreId"]          = new SelectList(_context.Stores, "StoreId", "StoreName", eBillPayment.StoreId);
            return(View(eBillPayment));
        }
        public async Task <IActionResult> Create([Bind("TalioringDeliveryId,DeliveryDate,TalioringBookingId,InvNo,Amount,Remarks,StoreId,UserId,EntryStatus,IsReadOnly")] TalioringDelivery talioringDelivery)
        {
            if (ModelState.IsValid)
            {
                _context.Add(talioringDelivery);
                new TailorManager().OnUpdateData(_context, talioringDelivery, false, false);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TalioringBookingId"] = new SelectList(_context.TalioringBookings.Where(c => !c.IsDelivered), "TalioringBookingId", "BookingSlipNo", talioringDelivery.TalioringBookingId);
            ViewData["StoreId"]            = new SelectList(_context.Stores, "StoreId", "StoreName", talioringDelivery.StoreId);
            return(View(talioringDelivery));
        }
Exemple #27
0
        public async Task <IActionResult> Create([Bind("OnlineSaleReturnId,OnlineSaleId,ReturnDate,InvNo,Amount,VoyagerInvoiceNo,VoygerDate,VoyagerAmount,Remarks,IsRecived,RecivedDate")] OnlineSaleReturn onlineSaleReturn)
        {
            if (ModelState.IsValid)
            {
                onlineSaleReturn.UserId = User.Identity.Name;
                _context.Add(onlineSaleReturn);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OnlineSaleId"] = new SelectList(_context.OnlineSales, "OnlineSaleId", "InvNo", onlineSaleReturn.OnlineSaleId);
            // ViewData["OnlineVendorId"] = new SelectList(_context.OnlineVendor, "OnlineVendorId", "OnlineVendorId", onlineSaleReturn.OnlineVendorId);
            return(PartialView(onlineSaleReturn));
        }
Exemple #28
0
        public async Task <IActionResult> Create([Bind("CashReceiptId,InwardDate,TranscationModeId,ReceiptFrom,Amount,SlipNo,Remarks,StoreId,UserId,EntryStatus,IsReadOnly")] CashReceipt cashReceipt)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cashReceipt);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TranscationModeId"] = new SelectList(_context.TranscationModes, "TranscationModeId", "Transcation", cashReceipt.TranscationModeId);
            // ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreId", cashReceipt.StoreId);
            ViewData["StoreId"] = ActiveSession.GetActiveSession(HttpContext.Session, HttpContext.Response, _returnUrl);

            return(View(cashReceipt));
        }
Exemple #29
0
        public async Task <IActionResult> Create([Bind("EmployeeId,FirstName,LastName,MobileNo, JoiningDate,LeavingDate,IsWorking,Category,IsTailors,EMail,DateOfBirth,AdharNumber,PanNo,OtherIdDetails,Address,City,State,FatherName,HighestQualification,StoreId,UserId,EntryStatus,IsReadOnly")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                await EmployeeManager.PostEmployeeAdditionAsync(_context, employee, _userManager);

                return(RedirectToAction(nameof(Index)));
            }
            //ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", employee.StoreId);
            StoreInfo storeInfo = PostLogin.ReadStoreInfo(HttpContext.Session);

            ViewData["StoreId"]  = storeInfo.StoreId;
            ViewData["UserName"] = storeInfo.UserName;
            return(View(employee));
        }
        public async Task <IActionResult> Create([Bind("ReceiptId,PartyName,RecieptSlipNo,OnDate,PayMode,BankAccountId,PaymentDetails,Amount,Remarks,PartyId,LedgerEnteryId,IsCash,StoreId,UserName")] Receipt receipt)
        {
            if (ModelState.IsValid)
            {
                if (receipt.PayMode == PaymentMode.Cash)
                {
                    receipt.BankAccountId = null;
                }
                _context.Add(receipt);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankAccountId"] = new SelectList(_context.BankAccounts, "BankAccountId", "Account", receipt.BankAccountId);
            ViewData["PartyId"]       = new SelectList(_context.Parties, "PartyId", "PartyName", receipt.PartyId);
            ViewData["StoreId"]       = ActiveSession.GetActiveSession(HttpContext.Session, HttpContext.Response, _returnUrl);

            return(View(receipt));
        }