public void GetDispatchDetails(string QCID)
        {
            long selQCID = 0;

            BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient();
            CustomProfile                  profile            = CustomProfile.GetProfile();
            iUCCommonFilterClient          objService         = new iUCCommonFilterClient();
            List <vGetUserProfileByUserID> UsersList          = new List <vGetUserProfileByUserID>();

            try
            {
                if (Session["QCID"] != null)
                {
                    selQCID = long.Parse(QCID.ToString());
                    BrilliantWMS.WMSOutbound.WMS_VW_GetDispatchDetails dispatchLst = new WMSOutbound.WMS_VW_GetDispatchDetails();
                    dispatchLst = Outbound.GetDispatchDetailsByQCID(selQCID, profile.DBConnection._constr);

                    lblDispatchNo.Text        = dispatchLst.ID.ToString();
                    UCDispatchDate.Date       = dispatchLst.DispatchDate;
                    txtRemark.Text            = dispatchLst.Remark.ToString();
                    txtAirwayBill.Text        = dispatchLst.AirwayBill.ToString();
                    txtShippingType.Text      = dispatchLst.ShippingType.ToString();
                    UC_ShippingDate.Date      = dispatchLst.ShippingDate;
                    UCExpDeliveryDate.Date    = dispatchLst.ExpDeliveryDate;
                    txtTransporterName.Text   = dispatchLst.TransporterName.ToString();
                    txtTransporterRemark.Text = dispatchLst.TransporterRemark.ToString();
                    long WarehouseID = long.Parse(dispatchLst.StoreId.ToString());

                    UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList();
                    UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList();
                    vGetUserProfileByUserID select = new vGetUserProfileByUserID()
                    {
                        userID = 0, userName = "******"
                    };
                    UsersList.Insert(0, select);
                    ddlDispatchBy.DataSource = UsersList;
                    ddlDispatchBy.DataBind();
                    ddlDispatchBy.SelectedIndex = ddlDispatchBy.Items.IndexOf(ddlDispatchBy.Items.FindByValue(dispatchLst.DispatchBy.ToString()));

                    ddlStatus.DataSource = WMFillStatus();
                    ddlStatus.DataBind();
                    ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(dispatchLst.Status.ToString()));

                    Grid1.DataSource = Outbound.GetDispatchSkuDetailByDispatchID(long.Parse(dispatchLst.ID.ToString()), profile.DBConnection._constr);
                    Grid1.DataBind();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'dvDDetail');LoadingOff();", true);
                }
                else if (Session["DispID"] != null)
                {
                    selQCID = long.Parse(QCID.ToString());
                    BrilliantWMS.WMSOutbound.WMS_VW_GetDispatchDetails dispatchLst = new WMSOutbound.WMS_VW_GetDispatchDetails();
                    dispatchLst               = Outbound.GetDispatchDetailsByDispatchID(selQCID, profile.DBConnection._constr);
                    lblDispatchNo.Text        = dispatchLst.ID.ToString();
                    UCDispatchDate.Date       = dispatchLst.DispatchDate;
                    txtRemark.Text            = dispatchLst.Remark.ToString();
                    txtAirwayBill.Text        = dispatchLst.AirwayBill.ToString();
                    txtShippingType.Text      = dispatchLst.ShippingType.ToString();
                    UC_ShippingDate.Date      = dispatchLst.ShippingDate;
                    UCExpDeliveryDate.Date    = dispatchLst.ExpDeliveryDate;
                    txtTransporterName.Text   = dispatchLst.TransporterName.ToString();
                    txtTransporterRemark.Text = dispatchLst.TransporterRemark.ToString();
                    long WarehouseID = long.Parse(dispatchLst.StoreId.ToString());

                    UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList();
                    UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList();
                    vGetUserProfileByUserID select = new vGetUserProfileByUserID()
                    {
                        userID = 0, userName = "******"
                    };
                    UsersList.Insert(0, select);
                    ddlDispatchBy.DataSource = UsersList;
                    ddlDispatchBy.DataBind();
                    ddlDispatchBy.SelectedIndex = ddlDispatchBy.Items.IndexOf(ddlDispatchBy.Items.FindByValue(dispatchLst.DispatchBy.ToString()));

                    ddlStatus.DataSource = WMFillStatus();
                    ddlStatus.DataBind();
                    ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(dispatchLst.Status.ToString()));

                    Grid1.DataSource = Outbound.GetDispatchSkuDetailByDispatchID(long.Parse(dispatchLst.ID.ToString()), profile.DBConnection._constr);
                    Grid1.DataBind();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'dvDDetail');LoadingOff();", true);
                }
                else if (Session["TRID"] != null)
                {
                    selQCID = long.Parse(QCID.ToString());
                    BrilliantWMS.WMSOutbound.WMS_VW_GetDispatchDetails dispatchLst = new WMSOutbound.WMS_VW_GetDispatchDetails();
                    dispatchLst = Outbound.GetDispatchDetailsByQCID(selQCID, profile.DBConnection._constr);

                    lblDispatchNo.Text        = dispatchLst.ID.ToString();
                    UCDispatchDate.Date       = dispatchLst.DispatchDate;
                    txtRemark.Text            = dispatchLst.Remark.ToString();
                    txtAirwayBill.Text        = dispatchLst.AirwayBill.ToString();
                    txtShippingType.Text      = dispatchLst.ShippingType.ToString();
                    UC_ShippingDate.Date      = dispatchLst.ShippingDate;
                    UCExpDeliveryDate.Date    = dispatchLst.ExpDeliveryDate;
                    txtTransporterName.Text   = dispatchLst.TransporterName.ToString();
                    txtTransporterRemark.Text = dispatchLst.TransporterRemark.ToString();
                    long WarehouseID = long.Parse(dispatchLst.StoreId.ToString());

                    UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList();
                    UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList();
                    vGetUserProfileByUserID select = new vGetUserProfileByUserID()
                    {
                        userID = 0, userName = "******"
                    };
                    UsersList.Insert(0, select);
                    ddlDispatchBy.DataSource = UsersList;
                    ddlDispatchBy.DataBind();
                    ddlDispatchBy.SelectedIndex = ddlDispatchBy.Items.IndexOf(ddlDispatchBy.Items.FindByValue(dispatchLst.DispatchBy.ToString()));

                    ddlStatus.DataSource = WMFillStatus();
                    ddlStatus.DataBind();
                    ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(dispatchLst.Status.ToString()));

                    Grid1.DataSource = Outbound.GetDispatchSkuDetailByDispatchID(long.Parse(dispatchLst.ID.ToString()), profile.DBConnection._constr);
                    Grid1.DataBind();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'dvDDetail');LoadingOff();", true);
                }
            }
            catch { }
            finally { Outbound.Close(); objService.Close(); UsersList.Clear(); }
        }