public void FillObjectList(string SelectedRecords, string ObjectName) { CustomProfile profile = CustomProfile.GetProfile(); BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient(); //iInboundClient Inbound = new iInboundClient(); iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { DataSet ds = new DataSet(); ds = Inbound.GetNextObject(SelectedRecords, ObjectName, profile.Personal.CompanyID, profile.DBConnection._constr); ddlObjectName.DataSource = ds; ddlObjectName.DataBind(); long WarehouseID = 0; string[] onePo = SelectedRecords.Split(','); long POID = 0; if (ObjectName == "PurchaseOrder") { POID = long.Parse(onePo[0].ToString()); BrilliantWMS.WMSInbound.tPurchaseOrderHead POHead = new WMSInbound.tPurchaseOrderHead(); //tPurchaseOrderHead POHead = new tPurchaseOrderHead(); POHead = Inbound.GetPoHeadByPOID(POID, profile.DBConnection._constr); WarehouseID = long.Parse(POHead.Warehouse.ToString()); } else if (ObjectName == "GRN") { long GRNID = long.Parse(onePo[0].ToString()); BrilliantWMS.WMSInbound.WMS_VW_GetGRNDetails GrnLst = new WMSInbound.WMS_VW_GetGRNDetails(); //WMS_VW_GetGRNDetails GrnLst = new WMS_VW_GetGRNDetails(); GrnLst = Inbound.GetGRNDetailsByGRNIDGRNMenu(GRNID, profile.DBConnection._constr); POID = long.Parse(GrnLst.OID.ToString()); BrilliantWMS.WMSInbound.tPurchaseOrderHead POHead = new WMSInbound.tPurchaseOrderHead(); //tPurchaseOrderHead POHead = new tPurchaseOrderHead(); POHead = Inbound.GetPoHeadByPOID(POID, profile.DBConnection._constr); WarehouseID = long.Parse(POHead.Warehouse.ToString()); } else if (ObjectName == "QC") { long QCID = long.Parse(onePo[0].ToString()); BrilliantWMS.WMSInbound.WMS_VW_GetQCDetails QClist = new WMSInbound.WMS_VW_GetQCDetails(); //WMS_VW_GetQCDetails QClist = new WMS_VW_GetQCDetails(); QClist = Inbound.GetQCDetailsByQCID(QCID, profile.DBConnection._constr); WarehouseID = long.Parse(QClist.WarehouseID.ToString()); } else if (ObjectName == "SalesOrder") { long SOID = long.Parse(onePo[0].ToString()); BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); BrilliantWMS.WMSOutbound.tOrderHead soHead = new WMSOutbound.tOrderHead(); //tOrderHead soHead = new tOrderHead(); soHead = Outbound.GetSoHeadBySOID(SOID, profile.DBConnection._constr); WarehouseID = long.Parse(soHead.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); ddlAssignTo.DataSource = UsersList; ddlAssignTo.DataBind(); } catch { } finally { Inbound.Close(); } //if (Request.QueryString["invoker"] != null) CurrentObject = Request.QueryString["invoker"].ToString(); //UCAssignTaskService.iUCAssignTaskClient ucAssignTaskService = new UCAssignTaskService.iUCAssignTaskClient(); //ddlObjectName.DataSource = ucAssignTaskService.GetObjectToBind(CurrentObject, profile.DBConnection._constr); //ddlObjectName.DataBind(); //ucAssignTaskService.Close(); }
public void fillUser() { BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient(); BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { CustomProfile profile = CustomProfile.GetProfile(); BrilliantWMS.WMSOutbound.tOrderHead OH = new WMSOutbound.tOrderHead(); long WarehouseID = 0; if (Session["QCID"] != null) { int chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "SalesOrder", profile.DBConnection._constr); if (chkJObCart >= 1) { DataSet dsJCN = new DataSet(); dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "SalesOrder", profile.DBConnection._constr); if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0) { //lblSelectedPO.Text = dsJCN.Tables[0].Rows[0]["OrderNo"].ToString(); //lblSelectedGTN.Text = dsJCN.Tables[0].Rows[0]["JobCardName"].ToString(); //lblPurchaseOrderDate.Text = dsJCN.Tables[0].Rows[0]["CreationDate"].ToString(); //lblPOBy.Text = dsJCN.Tables[0].Rows[0]["CreatedByUser"].ToString(); WarehouseID = long.Parse(dsJCN.Tables[0].Rows[0]["Warehouse"].ToString()); } } else { OH = Outbound.GetSoDetailByQCID(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), profile.DBConnection._constr); //lblSelectedPO.Text = Session["POID"].ToString(); //lblSelectedGTN.Text = "Not Created"; //lblPurchaseOrderDate.Text = POHead.POdate.Value.ToString("dd-MMM-yyyy"); //lblPOBy.Text = Inbound.GetUserNameByID(long.Parse(POHead.CreatedBy.ToString()), profile.DBConnection._constr); WarehouseID = long.Parse(OH.StoreId.ToString()); } } else if (Session["TRID"] != null) { int chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr); if (chkJObCart >= 1) { DataSet dsJCN = new DataSet(); dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr); if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0) { WarehouseID = long.Parse(dsJCN.Tables[0].Rows[0]["Warehouse"].ToString()); } } else { BrilliantWMS.WMSInbound.tTransferHead TRHead = new WMSInbound.tTransferHead(); TRHead = Inbound.GetTransferHeadByTRID(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), profile.DBConnection._constr); WarehouseID = long.Parse(TRHead.FromPosition.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(); } catch { } finally { objService.Close(); } }