Exemplo n.º 1
0
        protected override void Grid_ClickCell(GridRecord row, string command)
        {
            if (command == "IT_OPResult")
            {
                string opType  = row.Items.FindItemByKey("IT_OPType_ORI").Text;
                string gotoURL = string.Empty;

                if (opType == BenQGuru.eMES.Web.Helper.OPType.COMPLOADING)
                {
                    gotoURL = "FITOPResultComploadingQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.PACKING)
                {
                    gotoURL = "FITOPResultPackingQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.SN)
                {
                    gotoURL = "FITOPResultSNQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.TESTING)
                {
                    gotoURL = "FITOPResultTestingQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.TS)
                {
                    gotoURL = "FITOPResultTSQP.aspx";
                }

                Response.Redirect(string.Format("{0}?RCARD={1}", gotoURL, row.Items.FindItemByKey("IT_OP").Text));
            }

            if (command == "PackingDetail")
            {
                this.currentCartonNo = row.Items.FindItemByKey("IT_CartonNo").Text;
                this.gridHelper3.RequestData();
            }
        }
Exemplo n.º 2
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new OQCFacadeFactory(base.DataProvider).CreateOQCFacade();
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("CheckItemCode").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            object obj = _facade.GetOQCCheckList(strCode);

            if (obj != null)
            {
                return((OQCCheckList)obj);
            }
            return(null);
        }
Exemplo n.º 3
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new TSModelFacadeFactory(base.DataProvider).CreateTSModelFacade();
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("ErrorCauseGroup").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            object obj = _facade.GetErrorCauseGroup(strCode);

            if (obj != null)
            {
                return((ErrorCauseGroup)obj);
            }
            return(null);
        }
Exemplo n.º 4
0
        protected override object GetEditObject(GridRecord row)
        {
            if (facade == null)
            {
                facade = new BaseModelFacade(base.DataProvider);
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("VersionCode").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            object obj = facade.GetSoftWareVersion(strCode);

            if (obj != null)
            {
                return((SoftWareVersion)obj);
            }
            return(null);
        }
Exemplo n.º 5
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_InventoryFacade == null)
            {
                _InventoryFacade = new InventoryFacade(this.DataProvider);
            }
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new WarehouseFacade(base.DataProvider);
            }
            string checkNo = row.Items.FindItemByKey("CheckNo").Text;

            StockCheck check = (StockCheck)_WarehouseFacade.GetStockCheck(checkNo);

            if (check != null)
            {
                return(check);
            }

            return(null);
        }
Exemplo n.º 6
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    if (((InvTransferDetail)obj).TransferStatus != RecordStatus.RecordStatus_NEW)
                    {
                        WebInfoPublish.Publish(this, "$Error_OnlyNEWCanEdit", this.languageComponent1);
                        return;
                    }

                    this.cmdSave.Disabled      = false;
                    this.cmdAdd.Disabled       = true;
                    this.txtLineNoEdit.Enabled = false;
                    this.SetEditObject(obj);
                }
            }
        }
Exemplo n.º 7
0
        protected void cmdGridExport_ServerClick(object sender, System.EventArgs e)
        {
            WebDataGrid Grid2 = null;

            this.gridHelper = new GridHelperNew(this.gridWebGrid, this.DtSource);
            Grid2           = this.gridHelper.Grid;
            for (int i = Grid2.Rows.Count - 1; i >= 0; i--)
            {
                GridRecord row = Grid2.Rows[i];
                if (bool.Parse(row.Items.FindItemByKey(this.gridHelper.CheckColumnKey).Value.ToString()) &&
                    row.Items.FindItemByKey("ImportResult").Value.ToString() == "导入成功")
                {
                    Grid2.Rows.Remove(Grid2.Rows[i]);
                }
            }
            //Grid2.Columns.Remove(Grid2.Columns[0]);
            //this.WebGridExcelExporter1.Export(Grid2);

            //this.excelExporter.ExportNew(Grid2);
            this.GridExportExcColFir(Grid2);
        }
Exemplo n.º 8
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_PrintTemplateFacade == null)
            {
                _PrintTemplateFacade = new PrintTemplateFacade(base.DataProvider);
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("TemplateName").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            object obj = _PrintTemplateFacade.GetPrintTemplate(strCode);

            if (obj != null)
            {
                return((PrintTemplate)obj);
            }
            return(null);
        }
Exemplo n.º 9
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new BaseModelFacadeFactory(base.DataProvider).Create();
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("RouteCode").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            object obj = _facade.GetRoute(strCode);

            if (obj != null)
            {
                return((Route)obj);
            }
            return(null);
        }
Exemplo n.º 10
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new WarehouseFacade(base.DataProvider);
            }
            object objCode   = row.Items.FindItemByKey("FactoryCode").Value;
            string routeCode = string.Empty;

            if (objCode != null)
            {
                routeCode = objCode.ToString();
            }
            object obj = _facade.GetFactory(routeCode);

            if (obj != null)
            {
                return((Factory)obj);
            }
            return(null);
        }
Exemplo n.º 11
0
        //protected override object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row)
        //{
        //    if( facade==null )
        //    {
        //        facade = new BaseModelFacadeFactory(base.DataProvider).Create();
        //    }
        //    object obj = this.facade.GetRoute2Operation( this.txtRouteCodeQuery.Text.Trim(),row.Cells[2].Text.Trim());

        //    if (obj != null)
        //    {
        //        return (Route2Operation)obj;
        //    }

        //    return null;
        //}

        protected override object GetEditObject(GridRecord row)
        {
            if (facade == null)
            {
                facade = new BaseModelFacadeFactory(base.DataProvider).Create();
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("OPCode").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            object obj = facade.GetRoute2Operation(this.txtRouteCodeQuery.Text.Trim(), strCode);

            if (obj != null)
            {
                return((Route2Operation)obj);
            }
            return(null);
        }
        //private void gridWebGrid_ClickCellButton(object sender, Infragistics.WebUI.UltraWebGrid.CellEventArgs e)
        //{
        //    if (this.gridHelper.IsClickEditColumn(e))
        //    {
        //        object obj = this.GetEditObject(e.Cell.Row);

        //        if (obj != null)
        //        {
        //            this.SetEditObject(obj);

        //            this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
        //        }
        //        SetcbSourceSBOMEdit(false);
        //    }
        //    if (e.Cell.Column.Key == "itemrange")
        //    {
        //        Response.Redirect(this.MakeRedirectUrl("FOPBOMItemControlMP.aspx",
        //            new string[] { "itemcode", "opbomcode", "opbomversion", "opid", "opbomitemcode", "routecode", "OrgID" },
        //            new string[] { ItemCode, OPBOMCode, OPBOMVersion, OPID, e.Cell.Row.Cells[2].Text, RouteCode, OrgID.ToString() }));
        //    }
        //}

        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    this.SetEditObject(obj);

                    this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
                }
            }

            else if (commandName == "itemrange")
            {
                Response.Redirect(this.MakeRedirectUrl("FOPBOMItemControlMP.aspx",
                                                       new string[] { "itemcode", "opbomcode", "opbomversion", "opid", "opbomitemcode", "routecode", "OrgID" },
                                                       new string[] { ItemCode, OPBOMCode, OPBOMVersion, OPID, row.Items.FindItemByKey("OPBOMItemCode").Value.ToString(), RouteCode, OrgID.ToString() }));
            }
        }
Exemplo n.º 13
0
        protected override object GetEditObject(GridRecord row)
        {
            if (row.Items.FindItemByKey("TicketStatus").Value.ToString() == "关闭")
            {
                WebInfoPublish.Publish(this, "$BS_TicketStatus_IsClose", this.languageComponent1);
                return(null);
            }



            if (_iqcfacade == null)
            {
                _iqcfacade = new BenQGuru.eMES.IQC.IQCFacade(base.DataProvider);
            }

            object objASN = _iqcfacade.GetASN(row.Items.FindItemByKey("ReceiveNo").Value.ToString());

            if (objASN != null)
            {
                WebInfoPublish.Publish(this, "$BS_ReNo_Create_ANSNO $InvReceiptNO:" + row.Items.FindItemByKey("ReceiveNo").Value.ToString(), this.languageComponent1);
                return(null);
            }


            //object[] objs = _iqcfacade.QueryINVReceiptDetail2ReceiptNo(row.Cells[1].Value.ToString());
            //if (objs != null)
            //{
            //    WebInfoPublish.Publish(this, "$BS_ReNo_Create_Detail $InvReceiptNO:" + row.Cells[1].Value.ToString(), this.languageComponent1);
            //    return null;
            //}


            object obj = this._iqcfacade.GetINVRecepitForUpdate(row.Items.FindItemByKey("ReceiveNo").Value.ToString(), OrgId);

            if (obj != null)
            {
                return((Domain.IQC.InvReceipt)obj);
            }
            return(null);
        }
Exemplo n.º 14
0
        protected override object GetEditObject(GridRecord row)
        {
            if (row.Items.FindItemByKey("INQTY").Value.ToString() == "0")
            {
                BenQGuru.eMES.Common.ExceptionManager.Raise(this.GetType().BaseType, "$Error_NOEDIT_INQTY_IS_0");
                return(null);
            }
            if (facade == null)
            {
                facade = new WarehouseFacade(base.DataProvider);
            }
            //int orgId = GlobalVariables.CurrentOrganizations.First().OrganizationID;

            object obj = facade.GetAsndetailitem(row.Items.FindItemByKey("invno").Value.ToString(), int.Parse(row.Items.FindItemByKey("STLINE").Value.ToString()), row.Items.FindItemByKey("POITEMNO").Value.ToString(), row.Items.FindItemByKey("STNO").Value.ToString());

            if (obj != null)
            {
                return((Asndetailitem)obj);
            }

            return(null);
        }
Exemplo n.º 15
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);
                txtOldAlertItemEdit.Text = row.Items.FindItemByKey("AlertItemSequence").Text.Trim();
                if (obj != null)
                {
                    this.SetEditObject(obj);
                    this._ButtonHelper.PageActionStatusHandle(PageActionType.Update);
                    ViewState["editItemPK"] = ((AlertItem)obj).ItemSequence;
                }
            }

            if (commandName == "AlertMailSetup")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    string url = "./FAlertMailSettingMP.aspx?ITEMSEQUENCE=";
                    url += ((AlertItem)obj).ItemSequence;
                    url += "&FROMPAGE=AlertItem";

                    this.Response.Redirect(this.MakeRedirectUrl(url));
                }
            }

            if (commandName == "detail")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    RedirectToDetailPage(((AlertItem)obj).AlertType, ((AlertItem)obj).ItemSequence);
                }
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 点击编辑按钮后获取与当前行的记录对应的实体,删除时也会调用
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        protected override object GetEditObject(GridRecord row)
        {
            if (m_ItemLotFacade == null)
            {
                m_ItemLotFacade = new ItemLotFacade(this.DataProvider);
            }
            string strCode = string.Empty;
            object objCode = row.Items.FindItemByKey("ItemCode").Value;

            if (objCode != null)
            {
                strCode = objCode.ToString();
            }
            //避免使用row.Cells[1],应使用row.Cells.FromKey("ItemCode")
            object obj = m_ItemLotFacade.GetItem2LotCheck(strCode);

            if (obj != null)
            {
                return((Item2LotCheck)obj);
            }

            return(null);
        }
Exemplo n.º 17
0
        protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                string CheckNo = row.Items.FindItemByKey("CheckNo").Text;
                txtStockCheckCodeEdit.Text = CheckNo;
                string DQMCODE = row.Items.FindItemByKey("DQMCODE").Text;
                txtDQMCODEEdit.Text = DQMCODE;


                txtLocationCodeEdit.Text = row.Items.FindItemByKey("LocationCode").Text; //实际货位
                //string CARTONNO = row.Items.FindItemByKey("ACARTONNO").Text;
                txtCARTONNOEdit.Text = row.Items.FindItemByKey("ACARTONNO").Text;        //实际箱号
                string CheckQty = row.Items.FindItemByKey("CheckQty").Text;
                txtCheckQtyEdit.Text = CheckQty;

                string StorageCode = row.Items.FindItemByKey("StorageCode").Text;
                txtStorageCodeEdit.Text = StorageCode;

                txtsLocationCodeEdit.Text = row.Items.FindItemByKey("SLocationCode").Text; //库存货位
                txtsCARTONNOEdit.Text     = row.Items.FindItemByKey("SCARTONNO").Text;     //库存货位
            }
        }
Exemplo n.º 18
0
        //private void gridWebGrid_ClickCellButton(object sender, Infragistics.WebUI.UltraWebGrid.CellEventArgs e)
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);

                if (obj != null)
                {
                    this.SetEditObject(obj);

                    this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
                }
            }
            else if (commandName == "MO2Order")
            {
                //Response.Redirect(this.MakeRedirectUrl("../OQC/FItem2CheckListSP.aspx",new string[] {"itemcode"},new string[] {e.Cell.Row.Cells.FromKey("ItemCode").Text.Trim()}));
            }

            else if (commandName == "OrderDetail")
            {
                Response.Redirect(this.MakeRedirectUrl("FOrderDetailMP.aspx", new string[] { "OrderNO" }, new string[] { row.Items.FindItemByKey("OrderNO").Text.Trim() }));
            }
        }
Exemplo n.º 19
0
        private object GetEditObject(GridRecord row)
        {
            if (_sbomFacade == null)
            {
                _sbomFacade = new FacadeFactory(base.DataProvider).CreateSBOMFacade();
            }

            string itemcode    = this.ItemCode;
            string sbitemcode  = row.Items.FindItemByKey("SBOMItemCode").Value.ToString();
            string sbsitemcode = row.Items.FindItemByKey("SBOMSourceItemCode").Value.ToString();
            string sbitemqty   = row.Items.FindItemByKey("SBOMItemQty").Value.ToString();
            string effdate     = FormatHelper.TODateInt(DateTime.Parse(row.Items.FindItemByKey("EffectiveDate").Text).Date).ToString();


            object obj = this._sbomFacade.GetSBOM(itemcode, sbitemcode, sbsitemcode, sbitemqty, effdate, GlobalVariables.CurrentOrganizations.First().OrganizationID, string.Empty);

            if (obj != null)
            {
                return(obj);
            }

            return(null);
        }
Exemplo n.º 20
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            object obj = this.GetEditObject(row);


            if (obj != null)
            {
                if (commandName == "ReworkPassContent")
                {
                    Response.Redirect(this.MakeRedirectUrl("FReworkApproveResultMP.aspx", new string[] { "ReworkCode" }, new string[] { GetText(row.Items.FindItemByKey("ReworkCode").Text) }));
                }

                else if (commandName == "ReworkRangeMNID")
                {
                    if (_facade == null)
                    {
                        _facade = new ReworkFacadeFactory(base.DataProvider).Create();
                    }
                    object reworksheet = _facade.GetReworkSheet(GetText(row.Items.FindItemByKey("ReworkCode").Text));
                    if (reworksheet != null)
                    {
                        if (((ReworkSheet)reworksheet).ReworkType == BenQGuru.eMES.Web.Helper.ReworkType.REWORKTYPE_REMO)
                        {
                            ExceptionManager.Raise(this.GetType(), "$Error_Rework_NORange_For_REMO_TYPE");
                        }

                        Response.Redirect(this.MakeRedirectUrl("FReworkRangeSP_New.aspx", new string[] { "ReworkSheetCode" }, new string[] { GetText(row.Items.FindItemByKey("ReworkCode").Text) }));
                    }
                }

                else if (commandName == "Edit")
                {
                    this.SetEditObject(obj);
                    this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
                }
            }
        }
        protected override void Grid_ClickCell(GridRecord row, string command)
        {
            //string opType = e.Cell.Row.Cells[11].Text ;
            string opType = row.Items.FindItemByKey(" IT_OPType_ORI").Text;

            if (command == "IT_OPResult")
            {
                string gotoURL = string.Empty;

                if (opType == BenQGuru.eMES.Web.Helper.OPType.COMPLOADING)
                {
                    gotoURL = "FITOPResultComploadingQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.PACKING)
                {
                    gotoURL = "FITOPResultPackingQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.SN)
                {
                    gotoURL = "FITOPResultSNQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.TESTING)
                {
                    gotoURL = "FITOPResultTestingQP.aspx";
                }

                if (opType == BenQGuru.eMES.Web.Helper.OPType.TS)
                {
                    gotoURL = "FITOPResultTSQP.aspx";
                }

                Response.Redirect(string.Format("{0}?RCARD={1}", gotoURL, row.Items.FindItemByKey("IT_OP").Text));
            }
        }
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new ReportViewFacade(base.DataProvider);
            }
            RptViewDataSourceColumn rptviewdatasourcecolum = this._facade.CreateNewRptViewDataSourceColumn();

            rptviewdatasourcecolum.ColumnSequence = Convert.ToDecimal(FormatHelper.CleanString(row.Items.FindItemByKey("ColumnSequence").Text));
            rptviewdatasourcecolum.ColumnName     = FormatHelper.CleanString(row.Items.FindItemByKey("ColumnName").Text);
            rptviewdatasourcecolum.Description    = FormatHelper.CleanString(row.Items.FindItemByKey("Description").Text);
            rptviewdatasourcecolum.DataType       = FormatHelper.CleanString(row.Items.FindItemByKey("DataType").Value.ToString());
            if (row.Items.FindItemByKey("Visible").Text.ToLower() == "false" || row.Items.FindItemByKey("Visible").Text == "0")
            {
                rptviewdatasourcecolum.Visible = "0";
            }
            else
            {
                rptviewdatasourcecolum.Visible = "1";
            }
            rptviewdatasourcecolum.MaintainUser = this.GetUserCode();
            rptviewdatasourcecolum.DataSourceID = Convert.ToDecimal(datasourceid.Value);
            return(rptviewdatasourcecolum);
        }
Exemplo n.º 23
0
        protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName)
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }
            if (commandName == "Edit")
            {
                object obj = this.GetEditObject(row);
                if (obj != null)
                {
                    this.SetEditObject(obj);
                    this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
                }
            }
            else if (commandName == "LinkToCartonImport")
            {
                Response.Redirect(this.MakeRedirectUrl("FCreateCheckedPickLineMP.aspx",
                                                       new string[] { "PickNo" },
                                                       new string[] { txtPickNoQuery.Text }));
            }
            //if (commandName == "Edit")
            //{

            //    BenQGuru.eMES.Domain.MOModel.Material m = _WarehouseFacade.GetMaterialFromDQMCode(txtDQMCodeEdit.Text);

            //    BenQGuru.eMES.Domain.Warehouse.PickDetail d = (BenQGuru.eMES.Domain.Warehouse.PickDetail)_WarehouseFacade.GetPickdetail(txtPickNoQuery.Text, row.Items.FindItemByKey("PICKLINE").Text.Trim());
            //    txtPickLineEdit.Text = row.Items.FindItemByKey("PICKLINE").Text.Trim();
            //    txtDMESCEdit.Text = m.MchlongDesc;
            //    txtDQMCodeEdit.Text = d.DQMCode;
            //    txtNumEdit.Text = d.QTY.ToString();



            //}
        }
Exemplo n.º 24
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            //base.Grid_ClickCell(cell);

            if (commandName == "DetailsMore")
            {
                this.Response.Redirect(this.MakeRedirectUrl("./FPauseSequenceQueryNew.aspx",
                                                            new string[] { "storageCode", "stackCode", "palletCode", "itemCode", "pauseCode", "cancelCode" },
                                                            new string[] { "", "", "",
                                                                           "", row.Items.FindItemByKey("PauseCode").Value.ToString().Trim(), "" }));
            }

            if (commandName == "Download")
            {
                string pauseCode = row.Items.FindItemByKey("PauseCode").Value.ToString();
                string pauseQty  = row.Items.FindItemByKey("PauseCount").Value.ToString();

                if (facade == null)
                {
                    facade = new PauseFacade(base.DataProvider);
                }
                object[] pauseObj = facade.QueryPauseSequence("", "", "", "", pauseCode, "", false, 0, 100000);
                if (pauseObj == null)
                {
                    ExceptionManager.Raise(this.GetType(), "停发通知单不存在");
                }

                PauseQuery pauseQuery = pauseObj[0] as PauseQuery;

                string originalFilePath = this.Request.PhysicalApplicationPath + @"download\PauseCode.htm";
                if (!File.Exists(originalFilePath))
                {
                    ExceptionManager.Raise(this.GetType(), "文件[PauseCode.htm]不存在");
                }

                string fileContent = File.ReadAllText(originalFilePath, Encoding.GetEncoding("GB2312"));
                fileContent = fileContent.Replace("$$PauseCode$$", pauseCode);
                fileContent = fileContent.Replace("$$ModelCode$$", pauseQuery.MModelCode == "" ? " " : pauseQuery.MModelCode);
                fileContent = fileContent.Replace("$$BOMVersion$$", pauseQuery.BOM == "" ? " " : pauseQuery.BOM);
                fileContent = fileContent.Replace("$$ItemCode$$", pauseQuery.MCode == "" ? " " : pauseQuery.MCode);
                fileContent = fileContent.Replace("$$ItemDescription$$", pauseQuery.MDesc == "" ? " " : pauseQuery.MDesc);
                fileContent = fileContent.Replace("$$PauseQty$$", pauseQty == "" ? " " : pauseQty);
                fileContent = fileContent.Replace("$$PauseReason$$", pauseQuery.PauseReason == "" ? " " : pauseQuery.PauseReason);

                string downloadPhysicalPath = this.Request.PhysicalApplicationPath + @"upload\";
                if (!Directory.Exists(downloadPhysicalPath))
                {
                    Directory.CreateDirectory(downloadPhysicalPath);
                }

                string filename = string.Format("{0}_{1}_{2}", row.Items.FindItemByKey("PauseCode").Value.ToString(), FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString());
                string filepath = string.Format(@"{0}{1}{2}", downloadPhysicalPath, filename, ".xls");

                while (File.Exists(filepath))
                {
                    filename = string.Format("{0}_{1}", filename, "0");
                    filepath = string.Format(@"{0}{1}{2}", downloadPhysicalPath, filename, ".xls");
                }

                StreamWriter writer = new StreamWriter(filepath, false, System.Text.Encoding.GetEncoding("GB2312"));
                writer.Write(fileContent);
                writer.Flush();
                writer.Close();

                this.DownloadFile(filename);
            }
        }
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (_InventoryFacade == null)
            {
                _InventoryFacade = new InventoryFacade(base.DataProvider);
            }

            if (_warehouseFacade == null)
            {
                _warehouseFacade = new WarehouseFacade(base.DataProvider);
            }
            string      invNo = row.Items.FindItemByKey("InvNo").Text.Trim();
            InvoicesExt ext   = this._InventoryFacade.QueryInvoices(
                string.Empty,
                invNo,
                string.Empty,
                string.Empty,
                string.Empty,
                0,
                0,
                1, 1)[0] as InvoicesExt;

            string storageInType = ext.InvType;
            string asnAvailable  = ext.AsnAvailable;

            if (commandName == "CreateASN")
            {
                if (asnAvailable == "N")
                {
                    WebInfoPublish.Publish(this, "不可以创建入库指令", this.languageComponent1);
                    return;
                }



                if (!CanCreateASN(invNo))
                {
                    WebInfoPublish.Publish(this, "已超出" + invNo + "的数量或者入库需求已经被取消", this.languageComponent1);
                    return;
                }



                if (storageInType == "UB")
                {
                    Pick pick = (Pick)_InventoryFacade.GetPickByInvNo(invNo);
                    if (pick == null)
                    {
                        WebInfoPublish.Publish(this, "对应的拣货任务令不存在!", this.languageComponent1);
                        return;
                    }
                    if (pick.Status != "Close")
                    {
                        WebInfoPublish.Publish(this, "调拨单未出库", this.languageComponent1);
                        return;
                    }

                    bool isFirst = _InventoryFacade.IsFirstCreateAsn(invNo);
                    if (isFirst)
                    {
                        string stno = autoCreateASNFromCheckoutInfo(invNo, pick);
                        Response.Redirect(this.MakeRedirectUrl("FASNForBuyerAndLogisticMP.aspx",
                                                               new string[] { "InvNo", "StorageInType", "StNo" },
                                                               new string[] { invNo, storageInType, stno }));
                    }
                }


                if (isVendor)
                {
                    Response.Redirect(this.MakeRedirectUrl("FASNForVendorMP.aspx",
                                                           new string[] { "InvNo", "StorageInType" },
                                                           new string[] { invNo, storageInType }));
                }
                else
                {
                    Response.Redirect(this.MakeRedirectUrl("FASNForBuyerAndLogisticMP.aspx",
                                                           new string[] { "InvNo", "StorageInType" },
                                                           new string[] { invNo, storageInType }));
                }
            }
            else if (commandName == "LinkToDetail")
            {
                //67	7.完成字段为Y时,还能跳转。fix
                if (asnAvailable == "Y")
                {
                    return;
                }

                Response.Redirect(this.MakeRedirectUrl("FSAPStorageInDemandDeatil.aspx",
                                                       new string[] { "InvNo", "StorageInType", "StorageInType", "Complete", "VendorCode", "CreateUser" },
                                                       new string[] { invNo, storageInType,
                                                                      FormatHelper.CleanString(this.drpStorageInTypeQuery.SelectedValue),
                                                                      FormatHelper.CleanString(this.drpCompleteQuery.SelectedValue),
                                                                      FormatHelper.CleanString(this.txtVendorCodeQuery.Text),
                                                                      FormatHelper.CleanString(this.txtCreateUserQuery.Text), }));
            }
        }
Exemplo n.º 26
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            string strType = row.Items.FindItemByKey("RptEntryType").Value.ToString();

            if (strType == ReportEntryType.Folder)
            {
                return;
            }
            string strRptId = row.Items.FindItemByKey("ReportID").Value.ToString();

            if (commandName == "RptAccessRight")
            {
                string strBackUrl = "FRptEntryMP.aspx";
                string strUrl     = "FRptAccessRightMP.aspx?reportid=" + strRptId + "&backurl=" + strBackUrl;
                this.Response.Redirect(strUrl);
            }
            else if (commandName == "RptView")
            {
                ReportViewFacade  rptFacade  = new ReportViewFacade(this.DataProvider);
                RptViewDesignMain designMain = (RptViewDesignMain)rptFacade.GetRptViewDesignMain(strRptId);
                if (designMain == null)
                {
                    WebInfoPublish.Publish(this, "$Error_RequestUrlParameter_Lost", this.languageComponent1);
                    return;
                }
                if (designMain.Status != ReportDesignStatus.Publish)
                {
                    WebInfoPublish.Publish(this, "$ReportView_Status_Error", this.languageComponent1);
                    return;
                }

                string strScript = "ViewReport('" + this.VirtualHostRoot + "ReportView/FRptViewMP.aspx?reportid=" + strRptId + "');";
                //ClientScriptManager scriptManager = this.Page.ClientScript;
                //scriptManager.RegisterClientScriptBlock(typeof(string), "RptView", strScript);
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "RptView", strScript, true);
            }
            else if (commandName == "RptDownloadFile")
            {
                ReportViewFacade  rptFacade  = new ReportViewFacade(this.DataProvider);
                RptViewDesignMain designMain = (RptViewDesignMain)rptFacade.GetRptViewDesignMain(strRptId);
                string            strFile    = designMain.ReportFileName.Replace("\\", "/");;
                if (strFile != "")
                {
//                    Response.Write(string.Format(@"<script language=javascript>
//										window.top.document.getElementById('iframeDownload').src='" + string.Format(@"{0}FDownload.aspx", this.VirtualHostRoot)
//                        + "?fileName="
//                        + string.Format(@"{0}", strFile)
//                        + @"';</script>"));
                    string script = string.Format(@"
										window.top.document.getElementById('iframeDownload').src='"                                         + string.Format(@"{0}FDownload.aspx", this.VirtualHostRoot)
                                                  + "?fileName="
                                                  + string.Format(@"{0}", strFile)
                                                  + @"';");
                    ScriptManager.RegisterClientScriptBlock(this, GetType(), "DownLoadFile", script, true);
                }
            }
            else if (commandName == "RptDesign")
            {
                ReportViewFacade  rptFacade  = new ReportViewFacade(this.DataProvider);
                RptViewDesignMain designMain = (RptViewDesignMain)rptFacade.GetRptViewDesignMain(strRptId);
                string            strUrl     = "";
                if (designMain.ReportBuilder == ReportBuilder.OnLine)
                {
                    strUrl = "FRptDesignStep1MP.aspx?reportid=" + strRptId;
                }
                else
                {
                    strUrl = "FRptUploadStep1MP.aspx?reportid=" + strRptId;
                }
                Response.Redirect(strUrl);
            }
            else if (commandName == "RptPublish")
            {
                ReportViewFacade  rptFacade  = new ReportViewFacade(this.DataProvider);
                RptViewDesignMain designMain = (RptViewDesignMain)rptFacade.GetRptViewDesignMain(strRptId);
                if (designMain.Status == ReportDesignStatus.Initial ||
                    designMain.Status == ReportDesignStatus.ReDesign ||
                    designMain.Status == ReportDesignStatus.Publish)
                {
                    string strUrl = "FRptPublishDesignMP.aspx?reportid=" + strRptId;
                    this.Response.Redirect(strUrl);
                }
            }
        }
Exemplo n.º 27
0
 private object GetEditObject(GridRecord row)
 {
     return(null);
 }
Exemplo n.º 28
0
 protected override void Grid_ClickCell(GridRecord row, string commandName)
 {
 }
Exemplo n.º 29
0
        protected override void Grid_ClickCell(GridRecord row, string command)
        {
            if (command == "List")
            {
                object objTmp             = row.Items.FindItemByKey(this.rblSummaryTargetQuery.SelectedValue);
                string summaryObject      = row.Items.FindItemByKey(this.rblSummaryTargetQuery.SelectedValue).Text;
                string summaryObjectDesc  = string.Empty;
                string summaryObject1     = string.Empty;
                string summaryObject1Desc = string.Empty;
                if (this.rblSummaryTargetQuery.SelectedValue == TSInfoSummaryTarget.ErrorCause)
                {
                    summaryObjectDesc = row.Items.FindItemByKey("ErrorCauseDescription").Text;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue == TSInfoSummaryTarget.ErrorCauseGroup)
                {
                    summaryObjectDesc = row.Items.FindItemByKey("ErrorCauseGroupDescription").Text;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue == TSInfoSummaryTarget.ErrorCodeGroup)
                {
                    summaryObjectDesc = row.Items.FindItemByKey("ErrorCodeGroupDescription").Text;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue == TSInfoSummaryTarget.Duty)
                {
                    summaryObjectDesc = row.Items.FindItemByKey("ErrorDutyDescription").Text;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue == TSInfoSummaryTarget.ErrorCode)
                {
                    summaryObjectDesc  = row.Items.FindItemByKey("ErrorCodeDescription").Text;
                    summaryObject1     = row.Items.FindItemByKey(TSInfoSummaryTarget.ErrorCodeGroup).Text;
                    summaryObject1Desc = row.Items.FindItemByKey("ErrorCodeGroupDescription").Text;
                }


                this.Response.Redirect(
                    this.MakeRedirectUrl(
                        "FTSInfoListQP.aspx",
                        new string[] {
                    "12_ModelCode",
                    "12_ItemCode",
                    "12_MoCode",
                    "12_FrmResCodes",
                    "12_StartDate",
                    "12_EndDate",
                    "12_ECG",
                    "12_EC",
                    "12_ECS",
                    "12_ECSG",
                    "12_LOC",
                    "12_DUTY",
                    "12_SummaryTarget",
                    "12_SummaryObject",
                    "12_SummaryObjectDesc",
                    "12_SummaryObject1",
                    "12_SummaryObject1Desc",
                    "12_LotNo",
                    "12_Errorcomponent",
                    "12_FirstClassGroup",
                    "12_SecondClassGroup",
                    "12_ThirdClassGroup"
                },
                        new string[] {
                    FormatHelper.CleanString(this.drpFinishSemimanuProductQuery.SelectedValue),
                    FormatHelper.CleanString(this.txtConditionItem.Text),
                    FormatHelper.CleanString(this.txtConditionMo.Text),
                    FormatHelper.CleanString(this.txtFromResource.Text),
                    this.dateStartDateQuery.Text,
                    this.dateEndDateQuery.Text,
                    FormatHelper.CleanString(this.txtErrorCodeGroup.Text),
                    FormatHelper.CleanString(this.txtErrorCode.Text),
                    FormatHelper.CleanString(this.txtErrorCause.Text),
                    FormatHelper.CleanString(this.txtErrorCauseGroup.Text),
                    FormatHelper.CleanString(this.txtErrorLocation.Text),
                    FormatHelper.CleanString(this.txtErrorDuty.Text),
                    this.rblSummaryTargetQuery.SelectedValue,
                    summaryObject,
                    summaryObjectDesc,
                    summaryObject1,
                    summaryObject1Desc,
                    this.txtLotNo.Text.Trim().ToUpper(),
                    FormatHelper.CleanString(this.txtErrorcomponentQuery.Text),
                    FormatHelper.CleanString(this.drpFirstClassQuery.SelectedValue),
                    FormatHelper.CleanString(this.drpSecondClassQuery.SelectedValue),
                    FormatHelper.CleanString(this.drpThirdClassQuery.SelectedValue)
                })
                    );
            }
        }
Exemplo n.º 30
0
 protected virtual void Grid_ClickCell(GridRecord row, string command)
 {
     //需要子类自定义除了编辑按钮意外的其他按钮的点击事件
 }
Exemplo n.º 31
0
 /// <summary>
 /// Exports a single grid row to the specified worksheet.
 /// 
 /// </summary>
 protected virtual void ExportRow(GridRecord gridRecord, Worksheet worksheet, ref int rowIndex, int columnOffset, bool hasHiddenCols, int outlineLevel, bool hidden, string gridCssClass, string itemCssClass)
 {
     WorksheetRow worksheetRow = worksheet.Rows[rowIndex];
     worksheetRow.OutlineLevel = outlineLevel;
     worksheetRow.Hidden = hidden;
     int rowIndex1 = rowIndex;
     ExcelRowExportingEventArgs e = new ExcelRowExportingEventArgs(worksheet, worksheetRow, rowIndex1, columnOffset, outlineLevel, gridRecord, false, false, false);
     this.OnRowExporting(e);
     if (e.Cancel)
         return;
     WebDataGrid webDataGrid = gridRecord.Owner.ControlMain as WebDataGrid;
     int num = 0;
     foreach (ControlDataField controlDataField in (IVisibleItemsEnumerable)webDataGrid.Fields)
     {
         if (!controlDataField.Hidden && !controlDataField.HiddenByParent)
         {
             this.ExportCell(gridRecord.Items[controlDataField.Index], worksheetRow, rowIndex, columnOffset + num, gridCssClass, itemCssClass);
             ++num;
         }
     }
     ++rowIndex;
     if (gridRecord is ContainerGridRecord && ((ContainerGridRecord)gridRecord).HasRowIslands)
         this.ExportRowIslands(((ContainerGridRecord)gridRecord).RowIslands, worksheet, ref rowIndex, columnOffset + 1, outlineLevel + 1);
     this.OnRowExported(new ExcelRowExportedEventArgs(worksheet, worksheetRow, rowIndex1, columnOffset, outlineLevel, gridRecord, false, false, false));
 }