Ejemplo n.º 1
0
        public GetAssignTransferDataRes GetAssignTransferDetails(GetAssignTransferDataReq GATDReq)
        {
            GetAssignTransferDataRes GATDRes = new GetAssignTransferDataRes();

            try
            {
                if (GATDReq.UserId == 0)
                {
                    GATDRes.Status  = "Failure";
                    GATDRes.Message = "Invalid UserId";
                    return(GATDRes);
                }

                query                    = "Sp_AssignTransfer";
                dbcommand                = new SqlCommand(query, conn);
                dbcommand.CommandType    = CommandType.StoredProcedure;
                dbcommand.CommandTimeout = 0;
                dbcommand.Parameters.AddWithValue("@QueryType", "GetAssignTransferDetails");
                dbcommand.Parameters.AddWithValue("@UserId", GATDReq.UserId);
                dbcommand.Parameters.AddWithValue("@TATHID1", GATDReq.TATHID);
                dbcommand.Parameters.AddWithValue("@ActivityId", GATDReq.ActivityId);
                SqlDataAdapter daGetData = new SqlDataAdapter(dbcommand);
                DataSet        dsGetData = new DataSet();
                daGetData.Fill(dsGetData);

                if (Convert.ToString(dsGetData.Tables[0].Rows[0]["value"]) == "0")
                {
                    List <StillageList> StillageList = new List <StillageList>();
                    foreach (DataRow row in dsGetData.Tables[0].Rows)
                    {
                        StillageList A = new StillageList();
                        A.StillageID  = row["StickerId"].ToString();
                        A.StillageQty = row["StillageQty"].ToString();
                        A.ItemID      = row["ItemID"].ToString();
                        A.ItemDesc    = row["ItemDesc"].ToString();
                        StillageList.Add(A);
                    }
                    GATDRes.StillageList = StillageList;



                    GATDRes.Status  = "Success";
                    GATDRes.Message = "Data Send successfully";
                }
                else
                {
                    GATDRes.Status  = "Failure";
                    GATDRes.Message = "Stillages not found";
                }
            }
            catch (Exception Ex)
            {
                GATDRes.Status  = "Failure";
                GATDRes.Message = Ex.Message;
            }
            finally
            {
                dbcommand.Connection.Close();
            }
            return(GATDRes);
        }
Ejemplo n.º 2
0
        public GetAssignTransferDataRes GetAssignTransferHeader(GetAssignTransferDataReq GATDReq)
        {
            GetAssignTransferDataRes GATDRes = new GetAssignTransferDataRes();

            try
            {
                if (GATDReq.UserId == 0)
                {
                    GATDRes.Status  = "Failure";
                    GATDRes.Message = "Invalid UserId";
                    return(GATDRes);
                }

                query                    = "Sp_AssignTransfer";
                dbcommand                = new SqlCommand(query, conn);
                dbcommand.CommandType    = CommandType.StoredProcedure;
                dbcommand.CommandTimeout = 0;
                dbcommand.Parameters.AddWithValue("@QueryType", "GetAssignTransferData");
                dbcommand.Parameters.AddWithValue("@UserId", GATDReq.UserId);
                SqlDataAdapter daGetData = new SqlDataAdapter(dbcommand);
                DataSet        dsGetData = new DataSet();
                daGetData.Fill(dsGetData);

                if (Convert.ToString(dsGetData.Tables[0].Rows[0]["value"]) == "0")
                {
                    List <TransferList> TransferList = new List <TransferList>();
                    foreach (DataRow row in dsGetData.Tables[0].Rows)
                    {
                        TransferList A = new TransferList();
                        A.ActivityId      = row["ActivityId"].ToString();
                        A.IsTj            = Convert.ToInt16(row["IsTj"]);
                        A.NoOfStillages   = row["NoOfStillage"].ToString();
                        A.SiteId          = row["SiteId"].ToString();
                        A.WareHouseId     = row["WareHouseId"].ToString();
                        A.FromWareHouseId = row["FromWareHouseId"].ToString();
                        A.TATHID          = row["TATHID"].ToString();
                        TransferList.Add(A);
                    }
                    GATDRes.TransferList = TransferList;



                    GATDRes.Status  = "Success";
                    GATDRes.Message = "Data Send successfully";
                }
                else
                {
                    GATDRes.Status  = "Failure";
                    GATDRes.Message = "No assignments found";
                }
            }
            catch (Exception Ex)
            {
                GATDRes.Status  = "Failure";
                GATDRes.Message = Ex.Message;
            }
            finally
            {
                dbcommand.Connection.Close();
            }
            return(GATDRes);
        }