Exemplo n.º 1
0
        internal async Task <ReturnResponse> PickStart(GetPick getPick)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlCommand smd = new SqlCommand("pick_start", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;
                smd.Parameters.AddWithValue("@email_id", getPick.EmailId);
                smd.Parameters.AddWithValue("@user_zone", getPick.PickZone);
                smd.Parameters.AddWithValue("@shift", getPick.ShiftId);
                smd.Parameters.AddWithValue("@tray", getPick.TrayNo);
                smd.Parameters.AddWithValue("@work_type", getPick.WorkType);
                smd.Parameters.AddWithValue("@location_id", getPick.LocationId);
                await smd.ExecuteNonQueryAsync().ConfigureAwait(false);

                string json = smd.Parameters["@jsonOutput"].Value.ToString();
                smd.Dispose();
                ReturnResponse returnResponse = JsonConvert.DeserializeObject <ReturnResponse>(json);
                return(returnResponse);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
Exemplo n.º 2
0
 public async Task <JsonResult> PickStart([FromBody] GetPick getPick)
 {
     try
     {
         List <ReturnResponse> returnResponse = new List <ReturnResponse>
         {
             await _PickLogic.PickStart(getPick).ConfigureAwait(false)
         };
         if (returnResponse[0].barcode != null)
         {
             returnResponse[0].images = await _PickLogic.GetImage(returnResponse[0].barcode).ConfigureAwait(false);
         }
         return(new JsonResult(returnResponse));
     }
     catch (Exception ee)
     {
         return(await _PickLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
     }
 }