protected void Page_Load(object sender, System.EventArgs e) { if (!this.IsPostBack) { // 初始化页面语言 string CheckNo = Request.QueryString["CheckNo"]; string StorageCode = Request.QueryString["StorageCode"]; this.InitPageLanguage(this.languageComponent1, false); txtStorageCodeQuery.Text = StorageCode; txtStockCheckCodeQuery.Text = CheckNo; if (_WarehouseFacade == null) { _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); } if (_InventoryFacade == null) { _InventoryFacade = new BenQGuru.eMES.Material.InventoryFacade(base.DataProvider); } object[] objs = _WarehouseFacade.GetLocations(CheckNo, StorageCode, txtDQMCODEQuery.Text); this.drpLocationCodeQuery.Items.Add(new ListItem("", "")); int orgId = GlobalVariables.CurrentOrganizations.First().OrganizationID; if (objs != null && objs.Length > 0) { foreach (Location l in objs) { Location lll = (Location)_InventoryFacade.GetLocation(l.LocationCode, orgId); if (lll != null) { this.drpLocationCodeQuery.Items.Add(new ListItem(lll.LocationName, lll.LocationCode)); } else { this.drpLocationCodeQuery.Items.Add(new ListItem(l.LocationCode, l.LocationCode)); } } } } InitHander(); //txtPickNoQuery.Text = pickNO; this.InitWebGrid(); this.cmdQuery_Click(null, null); this.RequestData(); }
private void BuildParentDocTypeList() { //DropDownListBuilder builder = new DropDownListBuilder(this.drpDoctypeQuery); //if (_facade == null) //{ // _facade = new SystemSettingFacadeFactory(base.DataProvider).Create(); //} //builder.HandleGetObjectList = new GetObjectListDelegate(this._facade.GetAllDocType); //builder.Build("ParameterAlias", "ParameterAlias"); //this.drpDoctypeQuery.Items.Insert(0, ""); if (inventoryFacade == null) { inventoryFacade = new BenQGuru.eMES.Material.InventoryFacade(base.DataProvider); } object[] typlist = inventoryFacade.GetDoctypeByInvDocNo(); object[] namelist = inventoryFacade.GetDirnameByInvDocNo(); drpDoctypeQuery.Items.Clear(); this.drpDoctypeQuery.Items.Add(new ListItem("", "")); drpDirNameQuery.Items.Clear(); this.drpDirNameQuery.Items.Add(new ListItem("", "")); if (typlist != null) { foreach (InvDoc o in typlist) { this.drpDoctypeQuery.Items.Add(new ListItem(o.DocType, o.DocType)); } } if (namelist != null) { foreach (InvDoc o in namelist) { this.drpDirNameQuery.Items.Add(new ListItem(o.Dirname, o.Dirname)); } } this.drpDoctypeQuery.SelectedIndex = 0; this.drpDirNameQuery.SelectedIndex = 0; }
protected override void Grid_ClickCell(GridRecord row, string commandName) { try { if (commandName == "Docname") { if (_documentFacade == null) { _documentFacade = new DocumentFacade(this.DataProvider); } if (inventoryFacade == null) { inventoryFacade = new BenQGuru.eMES.Material.InventoryFacade(base.DataProvider); } //bool right = _documentFacade.GetDocDirRight(int.Parse(row.Items.FindItemByKey("Dirserial").Value.ToString()), this.GetUserCode(), "QUERY"); InvDoc doc = inventoryFacade.GetInvDoc(int.Parse(row.Items.FindItemByKey("Docserial").Value.ToString())) as InvDoc; if (doc != null) { //if (doc.Checkedstatus == "Y" && doc.Validstatus == "Y") //{ if (_facade == null) { _facade = new SystemSettingFacade(this.DataProvider); } //object parameter = _facade.GetParameter("DOCDIRPATH", "DOCDIRPATHGROUP"); //if (parameter != null) //{ //服务器目录路径 //string filePath = ((Domain.BaseSetting.Parameter)parameter).ParameterAlias; string filePath = System.AppDomain.CurrentDomain.BaseDirectory + "InvDoc/" + doc.Dirname; //+ "FileUpload"; if (filePath.LastIndexOf('\\') == filePath.Length - 1) { filePath = filePath.Substring(0, filePath.Length - 1); } #region//下载文件 FileInfo currentFile = new FileInfo(filePath + "/" + row.Items.FindItemByKey("ServerFullName").Value.ToString()); if (currentFile.Exists) { this.DownloadFileFull(this.VirtualHostRoot + "InvDoc/" + doc.Dirname + "/" + row.Items.FindItemByKey("ServerFullName").Value); } else { Log.Error(filePath + "/" + row.Items.FindItemByKey("ServerFullName").Value.ToString() + " 不存在!"); WebInfoPublish.PublishInfo(this, row.Items.FindItemByKey("ServerFullName").Value.ToString() + "不存在", this.languageComponent1); } #endregion //} //else //{ // WebInfoPublish.PublishInfo(this, "$Error_DocDirPath_NotExist", this.languageComponent1); //} // } // else // { // WebInfoPublish.PublishInfo(this, "$Error_FileIsNotCheckedOrValid", this.languageComponent1); // } } else { WebInfoPublish.PublishInfo(this, "$Error_HaveNoRightToDownload", this.languageComponent1); } } } catch (Exception ex) { Log.Error(ex.StackTrace); WebInfoPublish.PublishInfo(this, "$Error_QueryFile_Exception", this.languageComponent1); } }