public DeliveryMastersResponse GetMastersForDelivery(JObject input) { DeliveryMastersResponse objresponse = new DeliveryMastersResponse(); try { objresponse = objBookingBal.GetMastersForDelivery(input); } catch (Exception ex) { objresponse.StatusId = 0; objresponse.StatusMessage = ex.Message; } return(objresponse); }
public DeliveryMastersResponse GetMastersForDelivery(JObject input) { DeliveryMastersResponse objresponse = new DeliveryMastersResponse(); try { DataSet ds = new DataSet(); int counterid = Convert.ToInt32(CommonMethods.URLKeyDecrypt(Convert.ToString(input["CounterId"]))); int loginid = Convert.ToInt32(CommonMethods.URLKeyDecrypt(Convert.ToString(input["LoginId"]))); ds = objBookingDal.GetMastersForDelivery(counterid, loginid); if (ds != null) { if (ds.Tables.Count > 0) { var gctypes = ds.Tables[0].AsEnumerable().Where(a => a.Field <int>("MasterType") == 1). Select(x => new GCTypesResponse { GCTypeId = x.Field <int>("Id"), GCType = x.Field <string>("Name") }).ToList(); objresponse.GCTypes = gctypes; var productTypes = ds.Tables[1].AsEnumerable(). Select(x => new ProductTypesResponse { ProductTypeId = x.Field <int>("ProductTypeId"), ProductType = x.Field <string>("ProductType"), GCTypeId = x.Field <Nullable <int> >("GC_Type_Id") }).ToList(); objresponse.ProductTypes = productTypes; objresponse.StatusId = 1; objresponse.StatusMessage = "Valid"; } } } catch (Exception ex) { objresponse.StatusId = 0; objresponse.StatusMessage = ex.Message; } return(objresponse); }