コード例 #1
0
        internal async Task <DataTable> get_lines_with_ship_agent_code(HandoverLineNew handover_Line_New)
        {
            SqlConnection cn = null;

            try
            {
                string sub_manifest_no = "";
                for (int i = 0; i < handover_Line_New.sub_manifest_no.Length; i++)
                {
                    if (i == handover_Line_New.sub_manifest_no.Length - 1)
                    {
                        sub_manifest_no = sub_manifest_no + "'" + handover_Line_New.sub_manifest_no[i] + "'";
                    }
                    else
                    {
                        sub_manifest_no = sub_manifest_no + "'" + handover_Line_New.sub_manifest_no[i] + "',";
                    }
                }
                ;

                cn = Connection.GetConnection();
                SqlDataAdapter da = new SqlDataAdapter(@"SELECT 'TRUE' as condition, 
                                                        '0'  AS selected_item,
                                                        'No' AS cancelled, 
                                                        mlan.manifest_no,
                                                        mlan.sub_manifest_no,
                                                        mlan.[sub_manifest_line_no],
                                                        mlan.ship_agent_code, 
                                                        mlan.awb_no, 
                                                        mlan.web_order_no
                                                        FROM dbo.manifest_line_awb_no mlan 
                                                        INNER JOIN manifest_header mh ON mh.manifest_no = mlan.manifest_no 
                                                        WHERE mh.location_id = " + handover_Line_New.LocationId + " and mh.status = 'CREATED' AND mlan.ship_agent_code = '" + handover_Line_New.ship_agent_code + "' " +
                                                       "AND mlan.sub_manifest_no IN (" + sub_manifest_no + ") AND mlan.posted = 0", cn);
                DataTable dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                return(dt);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
コード例 #2
0
        public async Task <JsonResult> get_lines_with_ship_agent_code([FromBody] HandoverLineNew handover_Line_New)
        {
            try
            {
                DataTable dt = await _manifestLogic.get_lines_with_ship_agent_code(handover_Line_New).ConfigureAwait(false);

                if (dt.Rows.Count > 0)
                {
                    return(new JsonResult(dt));
                }
                else
                {
                    return(await _manifestLogic.SendRespose("False", "No Record Found").ConfigureAwait(false));
                }
            }
            catch (Exception ee)
            {
                return(await _manifestLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
            }
        }