Example #1
0
 public ActionResult WBRequisitionForCrusting()
 {
     ViewBag.formTiltle      = "Wet Blue Requisition For Crusting";
     ViewBag.ProductionFloor = DalCommon.GetStoreListForFixedCategoryType("Production", "CR Production");
     ViewBag.ConcernStore    = DalCommon.GetStoreListForFixedCategoryType("Leather", "Wet Blue");
     return(View());
 }
Example #2
0
        // ##################### Search Start ##############
        public ActionResult GetLcmLimInfo()
        {
            var listLcmLimInfo = (from temp in objRepository.LimInfoRepository.Get().AsEnumerable()
                                  join temp2 in objRepository.BankRepository.Get() on temp.LimBankID equals temp2.BankID
                                  join temp3 in objRepository.BranchRepository.Get() on temp.LimBranchID equals temp3.BranchID
                                  select new
            {
                LimID = temp.LimID,
                LCNo = temp.LCNo,
                LimNo = temp.LimNo,
                BankID = temp2.BankID,
                BranchID = temp3.BranchID,                      //temp.LCNo,
                BankCode = temp2.BankCode,
                BankName = temp2.BankName,
                BanchCode = temp3.BanchCode,
                BranchName = temp3.BranchName,
                LimBankID = temp.LimBankID,
                LimLimit = temp.LimLimit,
                LimBalance = temp.LimBalance,
                LimBranchID = temp.LimBranchID,
                LCID = temp.LCID,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),
            }).OrderByDescending(ob => ob.LimID);                       //obLCOpeningDAL.GetLCOpeningInfo();

            return(Json(listLcmLimInfo, JsonRequestBehavior.AllowGet));
        }
        // ##################### Save & Update End ##############

        // ##################### Search Start ##############
        public ActionResult GetInsuranceInfo()
        {
            var listLcmLimInfo = (from temp in objRepository.EXPDeliveryChallanRepository.Get().AsEnumerable()
                                  //join temp2 in objRepository.EXPDeliveryChallanCIRepository.Get() on temp.DeliverChallanID equals temp2.DeliverChallanID
                                  //join temp3 in objRepository.ExpCommercialInvoiceRepository.Get() on temp2.CIID equals temp3.CIID
                                  //join temp4 in objRepository.ExpPackingListRepository.Get() on temp2.PLID equals temp4.PLID
                                  select new
            {
                DeliverChallanID = temp.DeliverChallanID,
                DeliverChallanNo = temp.DeliverChallanNo,
                DeliverChallanDate = Convert.ToDateTime(temp.DeliverChallanDate).ToString("dd/MM/yyyy"),                      //temp.DeliverChallanDate,
                TruckNo = temp.TruckNo,
                DeliveryChallanNote = temp.DeliveryChallanNote,

                //CIID = temp2.CIID,
                //CINo = temp3.CINo,
                //CIAmount = temp3.CIAmount,
                //CIDate = Convert.ToDateTime(temp3.CIDate).ToString("dd/MM/yyyy"),
                //PLID = temp2.PLID,
                //PLNo = temp4.PLNo,
                //PLDate = Convert.ToDateTime(temp4.PLDate).ToString("dd/MM/yyyy"),
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),
            }).OrderByDescending(ob => ob.DeliverChallanID);                       //obLCOpeningDAL.GetLCOpeningInfo();

            return(Json(listLcmLimInfo, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        public ActionResult SearchLcmCnFBillInfoByLCNo(string search)//InsuranceNo
        {
            var lcInfo = (from temp in objRepository.ExpBankLoanRepository.Get().Where(ob => ob.RunningStatus == "RNG").AsEnumerable()
                          join temp2 in objRepository.BankRepository.Get() on temp.BankID equals temp2.BankID
                          join temp3 in objRepository.BranchRepository.Get() on temp.BranchID equals temp3.BranchID
                          join temp4 in objRepository.SysTransHeadRepository.Get() on temp.LoanHead equals temp4.HeadID

                          select new
            {
                BankLoanID = temp.BankLoanID == null ? 0 : temp.BankLoanID,
                BankLoanNo = temp.BankLoanNo == null ? "" : temp.BankLoanNo,
                LoanHead = temp.LoanHead == null ? 0 : temp.LoanHead,
                HeadID = temp4.HeadID == null ? 0 : temp4.HeadID,
                HeadName = temp4.HeadName == null ? "" : temp4.HeadName,
                BankID = temp.BankID == null ? 0 : temp.BankID,
                BankCode = temp2.BankCode == null ? "" : temp2.BankCode,
                BankName = temp2.BankName == null ? "" : temp2.BankName,
                BranchID = temp.BranchID == null ? 0 : temp.BranchID,
                BanchCode = temp3.BanchCode == null ? "" : temp3.BanchCode,
                BranchName = temp3.BranchName == null ? "" : temp3.BranchName,
                LoanAmt = temp.LoanAmt == null ? 0 : temp.LoanAmt,
                RunningStatus = temp.RunningStatus == null ? "" : temp.RunningStatus,
                ApprovalNote = temp.ApprovalNote == null ? "" : temp.ApprovalNote,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),
            }).OrderByDescending(ob => ob.BankLoanID);

            return(Json(lcInfo, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetBillOfLadingListA()
        {
            var pl = _unit.ExpBillOfLadingRepository.Get().Select(ob => new
            {
                ob.BLID,
                ob.BLNo,
                ob.RefBLNo,
                ob.Shipper,
                ShipperCode = ob.Shipper == null ? "" : _unit.SysBuyerRepository.GetByID(ob.Shipper).BuyerCode,
                ShipperName = ob.Shipper == null ? "" : _unit.SysBuyerRepository.GetByID(ob.Shipper).BuyerName,
                BLDate      = string.Format("{0:dd/MM/yyyy}", ob.BLDate),
                ob.CIID,
                CINo    = ob.CIID == null ? "" : _unit.ExpCommercialInvoiceRepository.GetByID(ob.CIID).CINo,
                CIRefNo = ob.CIID == null ? "" : _unit.ExpCommercialInvoiceRepository.GetByID(ob.CIID).CIRefNo,
                CIDate  = ob.CIID == null ? "" : string.Format("{0:dd/MM/yyyy}",
                                                               _unit.ExpCommercialInvoiceRepository.GetByID(ob.CIID).CIDate),
                OrdDeliveryMode = ob.CIID == null ? "" : DalCommon.ReturnOrderDeliveryMode(
                    _unit.ExpCommercialInvoiceRepository.GetByID(ob.CIID).OrdDeliveryMode),
                ShipmentFrom = ob.CIID == null ? "" : _unit.ExpCommercialInvoiceRepository.GetByID(ob.CIID).ShipmentFrom,
                ShipmentTo   = ob.CIID == null ? "" : _unit.ExpCommercialInvoiceRepository.GetByID(ob.CIID).ShipmentTo,
                RecordStatus = ob.CIID == null ? "" : DalCommon.ReturnRecordStatus(_unit.ExpBillOfLadingRepository.GetByID(ob.BLID).RecordStatus)
            }).ToList();

            return(Json(pl.OrderByDescending(ob => ob.BLID), JsonRequestBehavior.AllowGet));
        }
Example #6
0
        public Sys_Machine SetToModelObject(SysMachine model, int userid)
        {
            Sys_Machine Entity = new Sys_Machine();

            Entity.MachineID       = model.MachineID;
            Entity.MachineNo       = model.MachineNo;
            Entity.MachineName     = model.MachineName;
            Entity.MachineCategory = model.MachineCategory;
            Entity.MachineType     = model.MachineType;
            Entity.MachineCapacity = model.MachineCapacity;
            Entity.CapacityUnit    = model.CapacityUnit;
            if (model.InstallationDate == null)
            {
                Entity.InstallationDate = null;
            }
            else
            {
                Entity.InstallationDate = DalCommon.SetDate(model.InstallationDate);
            }
            if (model.ExpiaryDate == null)
            {
                Entity.ExpiaryDate = null;
            }
            else
            {
                Entity.ExpiaryDate = DalCommon.SetDate(model.ExpiaryDate);
            }
            Entity.Remarks   = model.Remarks;
            Entity.IsActive  = model.IsActive == "Active";
            Entity.SetOn     = DateTime.Now;
            Entity.SetBy     = userid;
            Entity.IPAddress = GetIPAddress.LocalIPAddress();

            return(Entity);
        }
Example #7
0
        public ActionResult SearchLcmLimInfoByLCNo(string search)//InsuranceNo
        {
            var lcInfo = (from temp in objRepository.LimInfoRepository.Get().Where(ob => ob.LCNo.StartsWith(search) || ob.LCNo == search).AsEnumerable()
                          join temp2 in objRepository.BankRepository.Get() on temp.LimBankID equals temp2.BankID
                          join temp3 in objRepository.BranchRepository.Get() on temp.LimBranchID equals temp3.BranchID
                          select new
            {
                LimBankID = temp.LimBankID,
                LimBranchID = temp.LimBranchID,
                LimID = temp.LimID,
                LimNo = temp.LimNo,
                LCID = temp.LCID,
                LCNo = temp.LCNo,
                LimLimit = temp.LimLimit,
                LimBalance = temp.LimBalance,
                BranchID = temp3.BranchID,              //temp.LCNo,
                BankID = temp2.BankID,
                BankCode = temp2.BankCode,
                BankName = temp2.BankName,
                BanchCode = temp3.BanchCode,
                BranchName = temp3.BranchName,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus)
            }).OrderByDescending(ob => ob.LimID);

            return(Json(lcInfo, JsonRequestBehavior.AllowGet));
        }
Example #8
0
        // ##################### Search Start ##############


        public ActionResult GetLcmRetirementInfo()
        {
            var listLcmRetirementInfo = (from temp in objRepository.LcmRetirementRpository.Get().AsEnumerable()
                                         join temp2 in objRepository.LCOpeningRepository.Get() on temp.LCID equals temp2.LCID
                                         join temp3 in objRepository.PRQ_ChemicalPIRepository.Get() on temp2.PIID equals temp3.PIID
                                         join temp4 in objRepository.SysSupplierRepository.Get() on temp3.SupplierID equals temp4.SupplierID

                                         select new
            {
                LCRetirementID = temp.LCRetirementID,
                LCRetirementNo = temp.LCRetirementNo,
                LCRetirementDate = temp.LCRetirementDate == null ? " " : Convert.ToDateTime(temp.LCRetirementDate).ToString("dd/MM/yyyy"),                      //temp.LCRetirementDate,
                LCID = temp.LCID,
                LCNo = temp.LCNo,
                LCDate = temp2.LCDate == null ? " " : Convert.ToDateTime(temp2.LCDate).ToString("dd/MM/yyyy"),
                SupplierID = temp4.SupplierName,
                SupplierName = temp4.SupplierName,
                BillValue = temp.BillValue,
                LessMargin = temp.LessMargin,
                ExchangeCurrency = temp.ExchangeCurrency,
                LCRCurrency = temp.LCRCurrency,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),  //temp.RecordStatus,
            }).OrderByDescending(ob => ob.LCRetirementID);                       //obLCOpeningDAL.GetLCOpeningInfo();

            return(Json(listLcmRetirementInfo, JsonRequestBehavior.AllowGet));
        }
 public ActionResult CLRequisitionForFinishing()
 {
     ViewBag.formTiltle      = "Crust Leather Requisition For Finishing";
     ViewBag.ProductionFloor = DalCommon.GetStoreListForFixedCategoryType("Production", "FN Production");
     ViewBag.ConcernStore    = DalCommon.GetStoreListForFixedCategoryType("Leather", "Crust");
     return(View());
 }
        public ActionResult SearchLcmCnFBillInfoByLCNo(string search)//InsuranceNo
        {
            var lcInfo = (from temp in repository.ExpCnfBill.Get().Where(ob => ob.CnfBillNo.StartsWith(search) || ob.CnfBillNo == search)
                          join temp2 in repository.ExpCommercialInvoiceRepository.Get() on temp.CIID equals temp2.CIID
                          join temp3 in repository.ExpPackingListRepository.Get() on temp.PLID equals temp3.PLID
                          join temp4 in repository.SysBuyerRepository.Get() on temp.CnfAgentID equals temp4.BuyerID
                          join temp5 in repository.EXPCommercialInvoicePIRepository.Get() on temp2.CIID equals temp5.CIID
                          join temp6 in repository.ExpLCOpening.Get() on temp5.LCID equals temp6.LCID
                          select new
            {
                CnfBillID = temp.CnfBillID,
                CnfBillNo = temp.CnfBillNo,
                CnfAgentID = temp.CnfAgentID == null ? 0 : temp.CnfAgentID,
                LCID = temp6.LCID == null ? 0 : temp6.LCID,
                LCNo = temp6.LCNo,
                CIID = temp2.CIID == null ? 0 : temp2.CIID,
                CINo = temp2.CINo,
                PLID = temp3.PLID == null ? 0 : temp3.PLID,
                PLNo = temp3.PLNo,
                BuyerCode = temp4.BuyerCode,
                BuyerName = temp4.BuyerName,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),
            }).OrderByDescending(ob => ob.CnfBillID);

            return(Json(lcInfo, JsonRequestBehavior.AllowGet));
        }
Example #11
0
        public ValidationMsg Save(SysTransHead objSysHead, int userID)
        {
            var vmMsg = new ValidationMsg();

            try
            {
                var tblSysHead = new Sys_TransHead
                {
                    HeadName     = objSysHead.HeadName,
                    HeadCode     = objSysHead.HeadCode,
                    HeadCategory = objSysHead.HeadCategory == "Addition" ? "AD" : "DD",
                    HeadType     = DalCommon.ReturnTransHeadType(objSysHead.HeadType),
                    IsActive     = objSysHead.IsActive == "Active",
                    SetOn        = DateTime.Now,
                    SetBy        = userID,
                    ModifiedOn   = DateTime.Now,
                    ModifiedBy   = userID,
                    IPAddress    = string.Empty
                };

                _context.Sys_TransHead.Add(tblSysHead);
                _context.SaveChanges();
                HeadID = tblSysHead.HeadID;

                vmMsg.Type = Enums.MessageType.Success;
                vmMsg.Msg  = "Save Successfully.";
            }
            catch (Exception ex)
            {
                vmMsg.Type = Enums.MessageType.Error;
                vmMsg.Msg  = "Failed to save.";
            }

            return(vmMsg);
        }
Example #12
0
        public ValidationMsg Update(SysTransHead objSysHead, int userID)
        {
            var vmMsg = new ValidationMsg();

            try
            {
                var Head = _context.Sys_TransHead.FirstOrDefault(s => s.HeadID == objSysHead.HeadID);

                if (Head != null)
                {
                    Head.HeadName     = objSysHead.HeadName;
                    Head.HeadCode     = objSysHead.HeadCode;
                    Head.HeadCategory = objSysHead.HeadCategory == "Addition" ? "AD" : "DD";
                    Head.HeadType     = DalCommon.ReturnTransHeadType(objSysHead.HeadType);
                    Head.IsActive     = objSysHead.IsActive == "Active";

                    Head.ModifiedOn = DateTime.Now;
                    Head.ModifiedBy = userID;
                }
                _context.SaveChanges();

                vmMsg.Type = Enums.MessageType.Update;
                vmMsg.Msg  = "Updated Successfully.";
            }
            catch (Exception ex)
            {
                vmMsg.Type = Enums.MessageType.Error;
                vmMsg.Msg  = "Failed to update.";
            }

            return(vmMsg);
        }
Example #13
0
        public ActionResult SearchWetBlueIssueNo(string search)
        {
            search = search.ToUpper();
            var data   = _dalWBIStoreSelectionObj.SearchMasterInfo();
            var result = (from temp in data
                          where ((temp.WBSelectionNo.ToUpper().StartsWith(search) || temp.WBSelectionNo.ToUpper() == search))
                          select new
            {
                IssueID = temp.IssueID,
                WBSIssueItemID = temp.WBSIssueItemID,
                SelectionNo = temp.WBSelectionNo,
                SelectionDate = temp.SelectionDate,
                SelectedBy = repository.SysUserRepository.Get(filter: ob => ob.UserID == temp.SelectedBy).FirstOrDefault().FirstName,
                IssueNo = temp.IssueNo,
                IssueDate = temp.IssueDate,
                IssueCategory = "After Production",
                //StoreID = temp.StoreID,
                //StoreName = temp.StoreName,
                //RecordStatus = temp.RecordStatus,
                IssueFrom = temp.IssueFrom,
                IssueTo = temp.IssueTo,
                IssueFromName = repository.StoreRepository.Get(filter: ob => ob.StoreID == temp.IssueFrom).FirstOrDefault().StoreName,
                IssueToName = repository.StoreRepository.Get(filter: ob => ob.StoreID == temp.IssueTo).FirstOrDefault().StoreName,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),
            }).ToList();


            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #14
0
        public Sys_Bank SetToModelObject(SysBank model, int userid, string url)
        {
            //const string chars = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789";
            //var random = new Random();
            //var result = new string(
            //    Enumerable.Repeat(chars, 8)
            //              .Select(s => s[random.Next(s.Length)])
            //              .ToArray());
            Sys_Bank entity = new Sys_Bank();

            entity.BankID        = model.BankID;
            entity.BankCode      = DalCommon.GetPreDefineNextCodeByUrl(url);
            entity.BankName      = model.BankName;
            entity.BankCategory  = model.BankCategory;
            entity.BankType      = model.BankType;
            entity.BankBINNo     = model.BankBINNo;
            entity.BankSwiftCode = model.BankSwiftCode;
            entity.IsActive      = model.IsActive == "Active";
            entity.SetOn         = model.BankID == 0 ? DateTime.Now : _context.Sys_Bank.FirstOrDefault(ob => ob.BankID == model.BankID).SetOn;
            entity.SetBy         = model.BankID == 0 ? userid : _context.Sys_Bank.FirstOrDefault(ob => ob.BankID == model.BankID).SetBy;
            entity.ModifiedOn    = model.BankID == 0 ? (DateTime?)null : DateTime.Now;
            entity.ModifiedBy    = model.BankID == 0 ? (int?)null : userid;
            entity.IPAddress     = string.Empty;
            return(entity);
        }
        public ActionResult SearchLCInfoByLCNo(string search)//InsuranceNo
        {
            var lcInfo = (from temp in repository.ExpLCOpening.Get().Where(ob => ob.LCNo.StartsWith(search) || ob.LCNo == search).AsEnumerable()
                          join temp2 in repository.BankRepository.Get() on temp.LCOpeningBank equals temp2.BankID
                          join temp3 in repository.BranchRepository.Get() on temp.AdvisingBank equals temp3.BranchID
                          join temp4 in repository.ExpLeatherPI.Get() on temp.PIID equals temp4.PIID


                          select new
            {
                LCID = temp.LCID,
                LCNo = temp.LCNo,
                PIID = temp.PIID,
                PINo = temp4.PINo,
                LCDate = Convert.ToDateTime(temp.LCDate).ToString("dd/MM/yyyy"),
                LCAmount = temp.LCAmount,
                LCOpeningBank = temp.LCOpeningBank,
                BankID = temp2.BankID,
                BankCode = temp2.BankCode,
                BankName = temp2.BankName,
                //AdvisingBankName = temp3.BranchName,
                BranchID = temp3.BranchID,
                BanchCode = temp3.BanchCode,
                BranchName = temp3.BranchName,
                AdvisingBankName = temp3.BranchName,
                RecordStatus = DalCommon.ReturnRecordStatus(temp.RecordStatus),
            }).OrderByDescending(ob => ob.LCID);

            return(Json(lcInfo, JsonRequestBehavior.AllowGet));
        }
Example #16
0
        public ValidationMsg Save(SysBank model, int _userid, string pageUrl)//, string pageUrl
        {
            vmMsg = new ValidationMsg();

            try
            {
                using (var tx = new TransactionScope())
                {
                    using (_context)
                    {
                        model.BankCode = DalCommon.GetPreDefineNextCodeByUrl(pageUrl);//DalCommon.GetPreDefineValue("1", "00045");
                        if (model.BankCode != null)
                        {
                            Sys_Bank tblBank = SetToBankModelObject(model, _userid);//, _userid
                            _context.Sys_Bank.Add(tblBank);
                            _context.SaveChanges();

                            if (model.Branches.Count > 0)
                            {
                                foreach (var branch in model.Branches)
                                {
                                    branch.BankID = tblBank.BankID;
                                    Sys_Branch tblBranch = SetToBranchModelObject(branch, _userid);
                                    _context.Sys_Branch.Add(tblBranch);
                                    _context.SaveChanges();
                                }
                            }
                            _context.SaveChanges();

                            tx.Complete();
                            //BankID = tblBank.BankID;

                            vmMsg.Type = Enums.MessageType.Success;
                            vmMsg.Msg  = "Saved Successfully.";
                        }
                    }
                }
            }


            catch (DbEntityValidationException e)
            {
                StringBuilder sb = new StringBuilder();
                foreach (var eve in e.EntityValidationErrors)
                {
                    sb.AppendLine(string.Format("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:",
                                                eve.Entry.Entity.GetType().Name,
                                                eve.Entry.State));
                    foreach (var ve in eve.ValidationErrors)
                    {
                        sb.AppendLine(string.Format("- Property: \"{0}\", Error: \"{1}\"",
                                                    ve.PropertyName,
                                                    ve.ErrorMessage));
                    }
                }
                throw new DbEntityValidationException(sb.ToString(), e);
            }
            return(vmMsg);
        }
Example #17
0
        public ActionResult GetIssue()
        {
            var issues = _unit.CrustLeatherIssue.Get().Select(issue => new
            {
                issue.CrustLeatherIssueID,
                issue.CrustLeatherIssueNo,
                CrustLeatherIssueDate = string.Format("{0:dd/MM/yyyy}", issue.CrustLeatherIssueDate),
                RecordStatus          = DalCommon.ReturnRecordStatus(issue.RecordStatus)
            }).ToList();

            return(Json(issues.OrderBy(ob => ob.CrustLeatherIssueDate), JsonRequestBehavior.AllowGet));
        }
Example #18
0
        public ActionResult GetComInv()
        {
            var comInvs = _unit.CommercialInvoiceRepository.Get().Select(comInv => new
            {
                comInv.CIID, comInv.CINo, comInv.LCID, comInv.LCNo,
                CIDate = string.Format("{0:dd/MM/yyyy}", comInv.CIDate),
                _unit.LCOpeningRepository.GetByID(comInv.LCID).PINo,
                RecordStatus = DalCommon.ReturnRecordStatus(comInv.RecordStatus)
            }).ToList();

            return(Json(comInvs.OrderByDescending(ob => ob.CIID), JsonRequestBehavior.AllowGet));
        }
Example #19
0
        public ActionResult GetExportLCRetirementList()
        {
            var data = from t in _repository.EXPLCRetirementRepository.Get()
                       select new
            {
                LCRetirementID   = t.LCRetirementID,
                LCRetirementNo   = t.LCRetirementNo,
                LCRetirementDate = Convert.ToDateTime(t.LCRetirementDate).ToString("dd/MM/yyyy"),
                RecordStatus     = DalCommon.ReturnRecordStatus(t.RecordStatus)
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #20
0
        public ActionResult GetExpCIList()
        {
            var data = from t in _repository.ExpCommercialInvoiceRepository.Get()
                       select new
            {
                CIID         = t.CIID,
                CINo         = t.CINo,
                CIDate       = Convert.ToDateTime(t.CIDate).ToString("dd/MM/yyyy"),
                RecordStatus = DalCommon.ReturnRecordStatus(t.RecordStatus)
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #21
0
        public ActionResult GetExportDeliveryChallanList()
        {
            var data = from t in _repository.EXPDeliveryChallanRepository.Get()
                       select new
            {
                DeliverChallanID   = t.DeliverChallanID,
                DeliverChallanNo   = t.DeliverChallanNo,
                DeliverChallanDate = Convert.ToDateTime(t.DeliverChallanDate).ToString("dd/MM/yyyy"),
                RecordStatus       = DalCommon.ReturnRecordStatus(t.RecordStatus)
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #22
0
        public ActionResult GetBuyerOrder(int buyerId)
        {
            var orders = _unit.SlsBuyerOrederRepository.Get().Where(ob => ob.BuyerID == buyerId).ToList();
            var result = orders.Select(order => new
            {
                order.BuyerOrderID,
                order.BuyerOrderNo,
                BuyerOrderDate = string.Format("{0:dd/MM/yyyy}", order.BuyerOrderDate),
                RecordStatus   = DalCommon.ReturnRecordStatus(order.RecordStatus)
            }).ToList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #23
0
        public ActionResult GetExportCnfBillList()
        {
            var data = from t in _repository.ExpCnfBill.Get()
                       select new
            {
                CnfBillID    = t.CnfBillID,
                CnfBillNo    = t.CnfBillNo,
                CnfBillDate  = Convert.ToDateTime(t.CnfBillDate).ToString("dd/MM/yyyy"),
                RecordStatus = DalCommon.ReturnRecordStatus(t.RecordStatus)
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #24
0
        public ValidationMsg Update(SysMachine objSysMachine, int userid)
        {
            var vmMsg = new ValidationMsg();

            try
            {
                var sysMachine = _context.Sys_Machine.FirstOrDefault(s => s.MachineID == objSysMachine.MachineID);
                if (sysMachine != null)
                {
                    sysMachine.MachineNo       = objSysMachine.MachineNo;
                    sysMachine.MachineName     = objSysMachine.MachineName;
                    sysMachine.MachineCategory = objSysMachine.MachineCategory;
                    sysMachine.MachineType     = objSysMachine.MachineType;
                    sysMachine.MachineCapacity = objSysMachine.MachineCapacity;
                    sysMachine.CapacityUnit    = objSysMachine.CapacityUnit;
                    if (objSysMachine.InstallationDate == null)
                    {
                        sysMachine.InstallationDate = null;
                    }
                    else
                    {
                        sysMachine.InstallationDate = DalCommon.SetDate(objSysMachine.InstallationDate);
                    }
                    if (objSysMachine.ExpiaryDate == null)
                    {
                        sysMachine.ExpiaryDate = null;
                    }
                    else
                    {
                        sysMachine.ExpiaryDate = DalCommon.SetDate(objSysMachine.ExpiaryDate);
                    }
                    //sysMachine.InstallationDate = DalCommon.SetDate(objSysMachine.InstallationDate);
                    //sysMachine.ExpiaryDate = DalCommon.SetDate(objSysMachine.ExpiaryDate);
                    sysMachine.Remarks    = objSysMachine.Remarks;
                    sysMachine.IsActive   = objSysMachine.IsActive == "Active";// Convert.ToBoolean(objSysMachine.IsActive);
                    sysMachine.ModifiedOn = DateTime.Now;
                    sysMachine.ModifiedBy = userid;
                    sysMachine.IPAddress  = GetIPAddress.LocalIPAddress();
                }
                _context.SaveChanges();

                vmMsg.Type = Enums.MessageType.Update;
                vmMsg.Msg  = "Updated Successfully.";
            }
            catch (Exception ex)
            {
                vmMsg.Type = Enums.MessageType.Error;
                vmMsg.Msg  = "Failed to Update.";
            }
            return(vmMsg);
        }
        public ActionResult GetTransChln()
        {
            var transChlns = _context.EXP_TransportChallan.ToList();
            var result     = transChlns.Select(chln => new
            {
                chln.TransportChallanID,
                chln.TransportChallanNo,
                chln.TransportChallanRef,
                TransportChallanDate = string.Format("{0:dd/MM/yyyy}", chln.TransportChallanDate),
                RecordStatus         = DalCommon.ReturnRecordStatus(chln.RecordStatus)
            }).ToList();

            return(Json(result.OrderByDescending(ob => ob.TransportChallanID), JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetDlvryChln()
        {
            var dlvryChlns = _unit.EXPDeliveryChallanRepository.Get().ToList();
            var result     = dlvryChlns.Select(chln => new
            {
                chln.DeliverChallanID,
                chln.DeliverChallanNo,
                chln.DeliverChallanRef,
                DeliverChallanDate = string.Format("{0:dd/MM/yyyy}", chln.DeliverChallanDate),
                RecordStatus       = DalCommon.ReturnRecordStatus(chln.RecordStatus)
            }).ToList();

            return(Json(result.OrderByDescending(ob => ob.DeliverChallanID), JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetLcBasicInfo()
        {
            var lcBasic = _unit.LCOpeningRepository.Get().Where(ob => /*ob.RecordStatus == "CNF" &&*/ ob.LCStatus == "RNG")
                          .ToList();

            var lstLcBasicsInfo = lcBasic.Select(item => new LcBasics
            {
                LCID         = item.LCID,
                LCNo         = item.LCNo,
                RecordStatus = DalCommon.ReturnRecordStatus(item.RecordStatus),
                LCDate       = item.LCDate.ToString("dd-MMM-yyyy")
            }).ToList();

            return(Json(lstLcBasicsInfo.OrderByDescending(ob => ob.LCID), JsonRequestBehavior.AllowGet));
        }
Example #28
0
        public ActionResult BuyerOrder(long buyerId)
        {
            var orders = _unit.SlsBuyerOrederRepository.Get().Where(ob => ob.BuyerID == buyerId)
                         .Select(order => new
            {
                order.BuyerOrderID,
                order.BuyerOrderNo,
                BuyerOrderDate = string.Format("{0:dd-mm-yyyy}", order.BuyerOrderDate),
                order.BuyerOrderStatus,
                BuyerName    = order.BuyerID == null ? "" : _unit.SysBuyerRepository.GetByID(order.BuyerID).BuyerName,
                RecordStatus = DalCommon.ReturnRecordStatus(order.RecordStatus)
            }).ToList();

            return(Json(orders.OrderByDescending(ob => ob.BuyerOrderID), JsonRequestBehavior.AllowGet));
        }
Example #29
0
        public ActionResult GetChemicalItemsForSearch()
        {
            var chemItems =
                _unit.SysChemicalItemRepository.Get()
                .Where(ob => ob.IsActive == true)
                .Select(ob => new
            {
                ob.ItemID,
                ob.ItemName,
                ob.HSCode,
                ItemCategory = DalCommon.ReturnChemicalItemCategory(ob.ItemCategory)
            }).ToList();

            return(Json(chemItems, JsonRequestBehavior.AllowGet));
        }
Example #30
0
        public ActionResult GetComInv()
        {
            var comInv = _unit.ExpCommercialInvoiceRepository.Get().ToList();
            var result = comInv.Select(inv => new
            {
                inv.CIID,
                inv.CINo,
                inv.CIRefNo,
                CIDate          = string.Format("{0:dd/MM/yyyy}", inv.CIDate),
                OrdDeliveryMode = DalCommon.ReturnOrderDeliveryMode(inv.OrdDeliveryMode),
                RecordStatus    = DalCommon.ReturnRecordStatus(inv.RecordStatus)
            });

            return(Json(result.OrderByDescending(ob => ob.CIID), JsonRequestBehavior.AllowGet));
        }