示例#1
0
 public ServiceResponseModel <List <MiscellaneousListModel> > GetAllChildeMiscellaneousListForManagerByMiscId(MiscellaneousServiceModel ObjServiceBaseModel)
 {
     try
     {
         var lstMiscellaneous        = new List <MiscellaneousListModel>();
         var ObjServiceResponseModel = new ServiceResponseModel <List <MiscellaneousListModel> >();
         if (ObjServiceBaseModel != null && ObjServiceBaseModel.ServiceAuthKey != null)
         {
             var userData = _workorderems.UserRegistrations.Where(x => x.ServiceAuthKey == ObjServiceBaseModel.ServiceAuthKey &&
                                                                  x.IsDeleted == false).FirstOrDefault();
             if (userData != null)
             {
                 lstMiscellaneous = _workorderems.spGetMiscellaneousDetail(ObjServiceBaseModel.MISCID)
                                    .Select(a => new MiscellaneousListModel()
                 {
                     Status        = a.Status,// "w" ? "Pending" : "Approved",
                     MISId         = "MIS" + a.LMIS_MIS_Id,
                     LocationName  = a.LocationName,
                     VendorName    = a.CMP_NameLegal,
                     InvoiceAmount = a.MISAmount,
                     MISDate       = a.MISDate,
                     UserName      = a.Employee_Name,
                     Document      = a.LMIS_InvoiceDocument == null? HostingPrefix + ProfilePicPath.Replace("~", "") + "no-profile-pic.jpg" : HostingPrefix + MiscellaneousImagePath.Replace("~", "") + a.LMIS_InvoiceDocument,
                     Comment       = a.LMIS_Comment,
                     MId           = a.LMIS_Id,
                     Vendor        = a.LMIS_ModifiedBy,
                     LocationId    = a.LMIS_LocationId
                 }).ToList();
                 if (lstMiscellaneous.Count > 0)
                 {
                     ObjServiceResponseModel.Response = Convert.ToInt32(ServiceResponse.SuccessResponse, CultureInfo.CurrentCulture);
                     ObjServiceResponseModel.Message  = CommonMessage.Successful();
                     ObjServiceResponseModel.Data     = lstMiscellaneous;
                 }
                 else
                 {
                     ObjServiceResponseModel.Response = Convert.ToInt32(ServiceResponse.NoRecord, CultureInfo.CurrentCulture);
                     ObjServiceResponseModel.Message  = CommonMessage.NoRecordMessage();
                     ObjServiceResponseModel.Data     = null;
                 }
             }
             else
             {
                 ObjServiceResponseModel.Response = Convert.ToInt32(ServiceResponse.NoRecord, CultureInfo.CurrentCulture);
                 ObjServiceResponseModel.Message  = CommonMessage.NoRecordMessage();
                 ObjServiceResponseModel.Data     = null;
             }
             return(ObjServiceResponseModel);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public ServiceResponseModel<List<MiscellaneousModel>> GetMiscellaneousList(ServiceBaseModel ObjServiceBaseModel)", "Exception While Getting List of Miscellaneous Cost code.", null);
         throw;
     }
 }
示例#2
0
 /// <summary>
 /// Created By: Ashwajit Bansod
 /// Created Date : Nov-13-2018
 /// Created For : To get list of all miscellaneous saved by employee.
 /// </summary>
 /// <param name="ObjServiceBaseModel"></param>
 /// <returns></returns>
 public ServiceResponseModel <List <MiscellaneousListModel> > GetAllMiscellaneousListForManager(MiscellaneousServiceModel ObjServiceBaseModel)
 {
     try
     {
         var lstMiscellaneous        = new List <MiscellaneousListModel>();
         var ObjServiceResponseModel = new ServiceResponseModel <List <MiscellaneousListModel> >();
         if (ObjServiceBaseModel != null && ObjServiceBaseModel.ServiceAuthKey != null)
         {
             var userData = _workorderems.UserRegistrations.Where(x => x.ServiceAuthKey == ObjServiceBaseModel.ServiceAuthKey &&
                                                                  x.IsDeleted == false).FirstOrDefault();
             if (userData != null)
             {
                 lstMiscellaneous = _workorderems.spGetMiscellaneousList(ObjServiceBaseModel.LocationId)
                                    .Select(a => new MiscellaneousListModel()
                 {
                     MISId         = "MIS" + a.LMIS_MIS_Id,
                     LocationName  = a.LocationName,
                     VendorName    = a.CMP_NameLegal,
                     InvoiceAmount = a.MISAmount,
                     MISDate       = a.MISDate,
                     UserName      = a.Employee_Name,
                     Status        = a.Status == "W" ? "Pending" : a.Status == "N"?"Pending":"Approved",
                 }).ToList();
                 if (lstMiscellaneous.Count > 0)
                 {
                     ObjServiceResponseModel.Response = Convert.ToInt32(ServiceResponse.SuccessResponse, CultureInfo.CurrentCulture);
                     ObjServiceResponseModel.Message  = CommonMessage.Successful();
                     ObjServiceResponseModel.Data     = lstMiscellaneous;
                 }
                 else
                 {
                     ObjServiceResponseModel.Response = Convert.ToInt32(ServiceResponse.NoRecord, CultureInfo.CurrentCulture);
                     ObjServiceResponseModel.Message  = CommonMessage.NoRecordMessage();
                     ObjServiceResponseModel.Data     = null;
                 }
             }
             else
             {
                 ObjServiceResponseModel.Response = Convert.ToInt32(ServiceResponse.NoRecord, CultureInfo.CurrentCulture);
                 ObjServiceResponseModel.Message  = CommonMessage.NoRecordMessage();
                 ObjServiceResponseModel.Data     = null;
             }
             return(ObjServiceResponseModel);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public ServiceResponseModel<List<MiscellaneousModel>> GetMiscellaneousList(ServiceBaseModel ObjServiceBaseModel)", "Exception While Getting List of Miscellaneous Cost code.", null);
         throw;
     }
 }