예제 #1
0
        protected void cmdCreateIQCFromASN_ServerClick(object sender, System.EventArgs e)
        {
            if (!ValidateInputForCreateIQCByASN())
            {
                return;
            }

            string asnNo = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtASNEdit.Text));

            if (_IQCFacade.CreateIQC("PO", asnNo, string.Empty, this.GetUserCode()))
            {
                this.txtASNEdit.Text = string.Empty;

                this.txtIQCNoQuery.Text                = string.Empty;
                this.txtASNPOQuery.Text                = asnNo;
                this.txtVendorCodeQuery.Text           = string.Empty;
                this.drpIQCStatusQuery.SelectedValue   = "New";
                this.drpROHSQuery.SelectedIndex        = 0;
                this.drpShipToStockQuery.SelectedIndex = 0;
                this.datAppDateFromQuery.Text          = string.Empty;
                this.datAppDateToQuery.Text            = string.Empty;

                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Query);
            }
            else
            {
                WebInfoPublish.PublishInfo(this, "$Error_InvalidASNToCreateIQC", languageComponent1);
            }
        }
예제 #2
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (facade == null)
            {
                facade = new InventoryFacade(base.DataProvider);
            }
            var pickDetail = (PickDetail)domainObject;

            try
            {
                this.DataProvider.BeginTransaction();
                ItemFacade itemFacade            = new ItemFacade();
                Domain.MOModel.Material material = (Domain.MOModel.Material)itemFacade.GetMaterial(pickDetail.MCode);
                if (material != null)
                {
                    material.MchlongDesc = this.txtMDescEdit.Text;
                    itemFacade.UpdateMaterial(material);
                }
                this.facade.UpdatePickDetail(pickDetail);
                this.DataProvider.CommitTransaction();
                WebInfoPublish.Publish(this, "更新成功", this.languageComponent1);
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                WebInfoPublish.PublishInfo(this, ex.Message, this.languageComponent1);
            }
        }
예제 #3
0
        protected override void cmdDelete_Click(object sender, EventArgs e)
        {
            if (_facade == null)
            {
                _facade = new MaterialFacade(this.DataProvider);
            }

            ArrayList            rowList           = this.gridHelper.GetCheckedRows();
            List <MaterialIssue> materialIssueList = new List <MaterialIssue>();

            foreach (UltraGridRow row in rowList)
            {
                if (row.Cells[6].Text == this.languageComponent1.GetString(MaterialIssueStatus.MaterialIssueStatus_Close))
                {
                    WebInfoPublish.PublishInfo(this, "$Close_Cannot_Delete", this.languageComponent1);
                    return;
                }
                MaterialIssue materialIssue = (MaterialIssue)_facade.GetMaterialIssue(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtBigSSCodeGroupQuery.Text)),
                                                                                      FormatHelper.TODateInt(this.txtPlanDateFromQuery.Text),
                                                                                      FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMoQuery.Text)),
                                                                                      Convert.ToDecimal(this.txtMOSeqQuery.Text.Trim()),
                                                                                      Convert.ToDecimal(row.Cells[1].Text));
                if (materialIssue != null)
                {
                    materialIssueList.Add(materialIssue);
                }
            }

            if (materialIssueList.Count > 0)
            {
                this._facade.DeleteMaterialIssue((MaterialIssue[])materialIssueList.ToArray());
            }

            this.RequestData();
        }
예제 #4
0
        protected void cmdIQCPrint_ServerClick(object sender, System.EventArgs e)
        {
            //获取用户选择的行和IQCHead
            ArrayList array = this.gridHelper.GetCheckedRows();

            List <IQCHeadWithVendor> items = new List <IQCHeadWithVendor>();

            foreach (GridRecord row in array)
            {
                object iqcHead = _IQCFacade.GetIQCHeadWithVendor(row.Items.FindItemByKey("IQCNo").Text);
                if (iqcHead != null && ((IQCHeadWithVendor)iqcHead).Status != IQCStatus.IQCStatus_New && ((IQCHeadWithVendor)iqcHead).Status != IQCStatus.IQCStatus_Cancel)
                {
                    items.Add((IQCHeadWithVendor)iqcHead);
                }
            }

            if (items == null || items.Count <= 0)
            {
                WebInfoPublish.PublishInfo(this, "$Message_NoIQCToPrint", languageComponent1);
            }
            else
            {
                DownloadIQCXlsFile(items);
            }
        }
예제 #5
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_RMAFacade == null)
            {
                _RMAFacade = new BenQGuru.eMES.MOModel.RMAFacade(base.DataProvider);
            }
            //已经关闭或结案的RMA不能新删除项目

            string RMABillCode = this.txtRMABillCode.Text.Trim();

            object obj = _RMAFacade.GetRMABill(RMABillCode);

            if (((RMABill)obj).Status == RMABillStatus.Closed)
            {
                WebInfoPublish.PublishInfo(this, "$BS_RMABillStatus_IsClose_CannotDelete", this.languageComponent1);
                return;
            }
            if (((RMABill)obj).Status == RMABillStatus.Opened)
            {
                WebInfoPublish.PublishInfo(this, "$BS_RMABillStatus_IsOpened_CannotDelete", this.languageComponent1);
                return;
            }

            _RMAFacade.DeleteRMADetial((Domain.RMA.RMADetial[])domainObjects.ToArray(typeof(Domain.RMA.RMADetial)));
        }
예제 #6
0
        private void Print()
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new WarehouseFacade(base.DataProvider);
            }
            if (this.gridWebGrid.Rows.Count <= 0)
            {
                return;
            }
            try
            {
                this.DataProvider.BeginTransaction();

                for (int i = 0; i < this.gridWebGrid.Rows.Count; i++)
                {
                    string  barno = this.gridWebGrid.Rows[i].Items.FindItemByKey("TDCartonNo").Value.ToString();
                    BarCode bar   = (BarCode)_WarehouseFacade.GetBarCode(barno);
                    bar.PrintTimes = bar.PrintTimes + 1;
                    _WarehouseFacade.UpdateBarCode(bar);
                }
                this.DataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                WebInfoPublish.PublishInfo(this, ex.Message, this.languageComponent1);
            }
        }
예제 #7
0
        protected void cmdSendCheck_ServerClick(object sender, System.EventArgs e)
        {
            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList items       = new ArrayList();
                ArrayList itemsFailed = new ArrayList();

                foreach (GridRecord row in array)
                {
                    object iqcHead = this.GetEditObject(row);
                    if (iqcHead != null)
                    {
                        if (((IQCHead)iqcHead).Status == IQCStatus.IQCStatus_New)
                        {
                            items.Add((IQCHead)iqcHead);
                        }
                        else
                        {
                            itemsFailed.Add((IQCHead)iqcHead);
                        }
                    }
                }

                _IQCFacade.SendCheckIQCHead((IQCHead[])items.ToArray(typeof(IQCHead)), this.GetUserCode());

                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Query);

                string message = string.Empty;

                if (items != null && items.Count > 0)
                {
                    message += "$Message_SendCheckOK" + " : \n";
                    foreach (IQCHead iqcHead in items)
                    {
                        message += iqcHead.IQCNo + "\n";
                    }
                }

                if (itemsFailed != null && itemsFailed.Count > 0)
                {
                    if (message.Trim().Length > 0)
                    {
                        message += "\n";
                    }
                    message += "$Message_SendCheckFailed" + " : \n";
                    foreach (IQCHead iqcHead in itemsFailed)
                    {
                        message += iqcHead.IQCNo + "\n";
                    }
                }

                if (message.Trim().Length > 0)
                {
                    WebInfoPublish.PublishInfo(this, message, languageComponent1);
                }
            }
        }
예제 #8
0
        //导入
        protected void cmdEnter_ServerClick(object sender, EventArgs e)
        {
            if (_InventoryFacade == null)
            {
                _InventoryFacade = new InventoryFacade(base.DataProvider);
            }
            string asnNo = FormatHelper.CleanString(this.txtStorageInASNEdit.Text);

            if (string.IsNullOrEmpty(asnNo))
            {
                WebInfoPublish.PublishInfo(this, "入库指令号为空", this.languageComponent1);
                return;
            }

            if (this.FileImport.PostedFile != null)
            {
                try
                {
                    HttpPostedFile postedFile = this.FileImport.PostedFile;

                    DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(base.DataProvider);
                    InvDoc     invDoc     = _InventoryFacade.CreateNewInvDoc();

                    invDoc.InvDocNo     = asnNo;
                    invDoc.InvDocType   = "DirectSign";
                    invDoc.DocType      = Path.GetExtension(postedFile.FileName);
                    invDoc.DocName      = Path.GetFileNameWithoutExtension(postedFile.FileName);
                    invDoc.DocSize      = postedFile.ContentLength / 1024;
                    invDoc.UpUser       = this.GetUserCode();
                    invDoc.UpfileDate   = dbDateTime.DBDate;
                    invDoc.MaintainUser = this.GetUserCode();
                    invDoc.MaintainDate = dbDateTime.DBDate;
                    invDoc.MaintainTime = dbDateTime.DBTime;
                    invDoc.Dirname      = "InvDoc";
                    string path     = Server.MapPath(this.VirtualHostRoot + "InvDoc/" + "直发入库客户接受凭证/");
                    string fileName = string.Format("{0}_DirectSign_{1}{2}{3}",
                                                    this.txtStorageInASNEdit.Text, dbDateTime.DBDate, dbDateTime.DBTime, invDoc.DocType);

                    invDoc.ServerFileName = fileName;

                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    invDoc.Dirname = "直发入库客户接受凭证";
                    this.FileImport.PostedFile.SaveAs(path + fileName);
                    _InventoryFacade.AddInvDoc(invDoc);
                    WebInfoPublish.PublishInfo(this, "$Success_UpLoadFile", this.languageComponent1);
                }
                catch (Exception ex)
                {
                    WebInfoPublish.PublishInfo(this, ex.Message, this.languageComponent1);
                }
            }
            else
            {
                WebInfoPublish.PublishInfo(this, "导入文件不能为空", this.languageComponent1);
            }
        }
예제 #9
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            try
            {
                if (commandName == "DOCNAME")
                {
                    if (_DocumentFacade == null)
                    {
                        _DocumentFacade = new DocumentFacade(this.DataProvider);
                    }
                    if (_DocumentFacade.GetDocDirRight(int.Parse(this.txtDocDirQuery.Text.Trim()), this.GetUserCode(), "QUERY"))
                    {
                        //下载文件
                        //if (_facade == null)
                        //{
                        //    _facade = new SystemSettingFacade(this.DataProvider);
                        //}
                        //object parameter = _facade.GetParameter("DOCDIRPATH", "DOCDIRPATHGROUP");
                        //if (parameter != null)
                        //{
                        //    //服务器目录路径
                        //    string filePath = ((Domain.BaseSetting.Parameter)parameter).ParameterAlias;
                        //    if (filePath.LastIndexOf('\\') == filePath.Length - 1)
                        //    {
                        //        filePath = filePath.Substring(0, filePath.Length - 1);
                        //    }
                        string filePath = System.AppDomain.CurrentDomain.BaseDirectory + "FileUpload";

                        #region  载文件
                        FileInfo currentFile = new FileInfo(filePath + "/" + row.Items.FindItemByKey("ServerFullName").Value.ToString());
                        if (currentFile.Exists)
                        {
                            this.DownloadFileFull(this.VirtualHostRoot + "FileUpload/" + row.Items.FindItemByKey("ServerFullName").Value.ToString());
                        }
                        else
                        {
                            WebInfoPublish.PublishInfo(this, "$Error_QueryFile_NotExist", this.languageComponent1);
                        }
                        #endregion
                        //}
                        //else
                        //{
                        //    WebInfoPublish.PublishInfo(this, "$Error_DocDirPath_NotExist", this.languageComponent1);
                        //}
                    }
                    else
                    {
                        WebInfoPublish.PublishInfo(this, "$Error_No_WatchFile_Right", this.languageComponent1);
                    }
                }
            }
            catch (Exception ex)
            {
                WebInfoPublish.PublishInfo(this, "$Error_QueryFile_Exception", this.languageComponent1);
            }
        }
예제 #10
0
        protected override void SetEditObject(object obj)
        {
            if (obj == null)
            {
                this.dateDateFrom.Date_String = FormatHelper.ToDateString(FormatHelper.TODateInt(DateTime.Now));
                this.txtBigSSCodeGroup.Text   = "";
                this.txtMactureSeq.Text       = "";
                this.txtMOEdit.Text           = "";
                this.txtMOSeqEdit.Text        = "";
                this.txtPlanInQTYEdit.Text    = "";
                this.timeFrom.Text            = "";
                this.txtBigSSCodeGroup.Text   = "";
                this.txtMat.Text    = "";
                this.txtAct.Text    = "";
                this.txtActQty.Text = "";

                return;
            }

            //	执行状态为“待投产”、“生产中”状态的计划信息可以修改除主键之外的其他信息【包括导入过程中的修改】,如果计划日期早于当前日期,则不允许修改计划信息
            ShiftModelFacade shiftModelFacade = new ShiftModelFacade(base.DataProvider);
            DBDateTime       dbDateTime       = FormatHelper.GetNowDBDateTime(base.DataProvider);

            int shiftDay = shiftModelFacade.GetShiftDayByBigSSCode(((WorkPlan)obj).BigSSCode, dbDateTime.DateTime);

            if (((WorkPlan)obj).PlanDate < shiftDay)
            {
                WebInfoPublish.PublishInfo(this, "$if_date_cannotmodify", languageComponent1);

                return;
            }

            if (((WorkPlan)obj).ActionStatus == WorkPlanActionStatus.WorkPlanActionStatus_Close)
            {
                WebInfoPublish.PublishInfo(this, "$status_error", languageComponent1);
                return;
            }



            this.dateDateFrom.Date_String = FormatHelper.ToDateString(((WorkPlan)obj).PlanDate);
            this.txtBigSSCodeGroup.Text   = ((WorkPlan)obj).BigSSCode;
            this.txtMactureSeq.Text       = ((WorkPlan)obj).PlanSeq.ToString();
            this.txtMOEdit.Text           = ((WorkPlan)obj).MoCode;
            this.txtMOSeqEdit.Text        = ((WorkPlan)obj).MoSeq.ToString();
            this.txtPlanInQTYEdit.Text    = ((WorkPlan)obj).PlanQty.ToString();
            this.timeFrom.Text            = FormatHelper.ToTimeString(((WorkPlan)obj).PlanStartTime);
            this.txtAct.Text    = ((WorkPlan)obj).ActionStatus.ToString();
            this.txtMat.Text    = ((WorkPlan)obj).MaterialStatus.ToString();
            this.txtActQty.Text = ((WorkPlan)obj).ActQty.ToString();
        }
예제 #11
0
        //protected override void Delete1DomainObjects(ArrayList domainObjects)
        //{
        //    if (_facade == null)
        //    {
        //        _facade = new PerformanceFacade(base.DataProvider);
        //    }
        //    //this._facade.DeleteExceptionCode((ExceptionCode[])domainObjects.ToArray(typeof(ExceptionCode)));

        //    for (int i = 0; i < domainObjects.Count; i++)
        //    {
        //        ExceptionCode exceptionCode = (ExceptionCode)domainObjects[i];
        //        ExceptionEventList = _facade.QueryExceptionEvent(string.Empty, 0, string.Empty, string.Empty, exceptionCode.Code);
        //        if (ExceptionEventList!=null)
        //        {
        //            for (int j = 0; j < ExceptionEventList.Length; j++)
        //            {
        //                _facade.DeleteExceptionEvent((ExceptionEvent)ExceptionEventList[j]);
        //            }
        //        }
        //    }
        //}

        protected void Delete1DomainObjects(object sender, EventArgs e)
        {
            if (_facade == null)
            {
                _facade = new PerformanceFacade(base.DataProvider);
            }
            this.DataProvider.BeginTransaction();
            try
            {
                bool      haveExceptionEvent = false;
                ArrayList array             = this.gridHelper.GetCheckedRows();
                string    exceptionCodeList = string.Empty;
                for (int i = 0; i < array.Count; i++)
                {
                    string        exceptionCode       = ((GridRecord)array[i]).Items.FindItemByKey("ExceptionCode").Value.ToString();
                    ExceptionCode exceptionCodeObject = (ExceptionCode)_facade.GetExceptionCode(exceptionCode);

                    object[] ExceptionEventList = _facade.QueryExceptionEvent(string.Empty, 0, string.Empty, string.Empty, exceptionCode);
                    if (ExceptionEventList != null)
                    {
                        haveExceptionEvent = true;
                        exceptionCodeList += exceptionCode + ",";
                        //for (int j = 0; j < ExceptionEventList.Length; j++)
                        //{
                        //    _facade.DeleteExceptionEvent((ExceptionEvent)ExceptionEventList[j]);
                        //}
                    }
                    else
                    {
                        if (exceptionCodeObject != null)
                        {
                            _facade.DeleteExceptionCode(exceptionCodeObject);
                        }
                    }
                }
                this.DataProvider.CommitTransaction();

                if (haveExceptionEvent)
                {
                    WebInfoPublish.PublishInfo(this, exceptionCodeList + "$Error_ExceptionCode_Cannot_Delete", this.languageComponent1);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_Delete_Domain_Object", ex);
                this.DataProvider.RollbackTransaction();
            }


            this.RequestData();
        }
예제 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string fullname = Request.QueryString["PICFULLNAME"];

            if (!string.IsNullOrEmpty(fullname))
            {
                try
                {
                    if (_facade == null)
                    {
                        _facade = new SystemSettingFacade(this.DataProvider);
                    }
                    //object parameter = _facade.GetParameter("PICUPLOADPATH", "ESOPPICDIRPATHGROUP");
                    //if (parameter != null)
                    //{
                    //服务器目录路径
                    string filePath = System.AppDomain.CurrentDomain.BaseDirectory
                                      + "ESFileUpload"; //((Domain.BaseSetting.Parameter)parameter).ParameterAlias;
                    if (!Directory.Exists(filePath))
                    {
                        Directory.CreateDirectory(filePath);
                    }
                    DirectoryInfo dir = new DirectoryInfo(filePath);
                    foreach (FileInfo file in dir.GetFiles())
                    {
                        if (file.Name == (fullname))
                        {
                            string currentPath = filePath + "\\" + fullname;
                            using (FileStream fs = new FileStream(currentPath, FileMode.Open))
                            {
                                byte[] bytes = new byte[fs.Length];
                                fs.Seek(0, SeekOrigin.Begin);
                                fs.Read(bytes, 0, (int)fs.Length);
                                Response.ContentType = "image/jpg";
                                using (System.Drawing.Image theImage = System.Drawing.Image.FromStream(fs))
                                    theImage.Save(Context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
                                Response.BinaryWrite(bytes);
                                fs.Flush();
                                fs.Close();
                            }
                        }
                    }
                    //}
                }
                catch (Exception ex)
                {
                    WebInfoPublish.PublishInfo(this, "$Error_UpLoadFile_Exception", this.languageComponent1);
                    return;
                }
            }
        }
예제 #13
0
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblRMABillCode, txtRMABillEidt, 40, true));

            if (!manager.Check())
            {
                WebInfoPublish.PublishInfo(this, manager.CheckMessage, languageComponent1);
                return(false);
            }

            return(true);
        }
예제 #14
0
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblFactoryQuery, txtFactoryQuery, int.MaxValue, true));
            manager.Add(new LengthCheck(lblStorageQuery, txtStorageQuery, int.MaxValue, true));

            if (!manager.Check())
            {
                WebInfoPublish.PublishInfo(this, manager.CheckMessage, languageComponent1);
                return(false);
            }

            return(true);
        }
예제 #15
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblItemCodeEdit, txtItemCode, 40, true));
            manager.Add(new LengthCheck(this.lblOPCodeEdit, txtOplist, 40, true));
            manager.Add(new NumberCheck(lblPICOrderEdit, txtPICOrderEdit, 0, 40, true));
            manager.Add(new LengthCheck(this.lblPICMemo, this.txtPICMemoEdit, 40, false));
            manager.Add(new LengthCheck(this.lblPICTitle, this.txtPICTitleEdit, 40, false));
            //manager.Add(new LengthCheck(this.lblPICTypeEdit, this.DropdownlistPICType, 40, true));
            if (!manager.Check())
            {
                WebInfoPublish.PublishInfo(this, manager.CheckMessage, languageComponent1);
                return(false);
            }

            if (!chkOInstruction.Checked && !chkMInstruction.Checked)
            {
                WebInfoPublish.PublishInfo(this, "$Error_PicType_NotCheck", this.languageComponent1);
                return(false);
            }

            HttpFileCollection files      = HttpContext.Current.Request.Files;
            HttpPostedFile     postedFile = fileUpload.PostedFile;

            if (postedFile != null && postedFile.FileName.Trim() != string.Empty)
            {
                //Check extension
                string extension = Path.GetExtension(postedFile.FileName);
                if (string.Compare(extension, ".jpg", true) != 0)
                {
                    WebInfoPublish.PublishInfo(this, "$Error_CS_File_Format_Error", this.languageComponent1);
                    return(false);
                }
            }
            else
            {
                //Check unUpload
                if (string.IsNullOrEmpty(this.HiddenPicFullName.Text))
                {
                    WebInfoPublish.PublishInfo(this, "$Error_UploadFileIsEmpty", this.languageComponent1);
                    return(false);
                }
            }

            return(true);
        }
예제 #16
0
        //确定
        protected void cmdOK_Click(object sender, EventArgs e)
        {
            //只能选一笔
            string exceptionSerial = "";
            int    count           = 0;

            if (Request.QueryString["Action"] != null && Request.QueryString["Action"].ToString() == "Multi")
            {
                for (int i = 0; i < this.gridUnSelected.Rows.Count; i++)
                {
                    if (this.gridUnSelected.Rows[i].Items.FindItemByKey(gridUnSelectedHelper.CheckColumnKey).ToString().ToUpper() == "TRUE")
                    {
                        if (exceptionSerial == "")
                        {
                            exceptionSerial = this.gridUnSelected.Rows[i].Items.FindItemByKey("Selector_UnselectedCode").Value.ToString();
                        }
                        else
                        {
                            exceptionSerial += "," + this.gridUnSelected.Rows[i].Items.FindItemByKey("Selector_UnselectedCode").Value.ToString();
                        }
                    }
                }
            }
            else
            {
                for (int i = 0; i < this.gridUnSelected.Rows.Count; i++)
                {
                    if (this.gridUnSelected.Rows[i].Items.FindItemByKey(gridUnSelectedHelper.CheckColumnKey).Value.ToString().ToUpper() == "TRUE")
                    {
                        if (exceptionSerial == "")
                        {
                            exceptionSerial = this.gridUnSelected.Rows[i].Items.FindItemByKey("Selector_UnselectedCode").Value.ToString();
                        }
                        count++;
                    }
                }
                if (count > 1)
                {
                    WebInfoPublish.PublishInfo(this, "$CS_GRID_SELECT_ONE_RECORD", this.languageComponent1);
                    return;
                }
            }

            //this.ClientScript.RegisterStartupScript(this.GetType(), "", "window.returnValue='" + exceptionSerial + "';window.close();", true);
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "window.returnValue='" + exceptionSerial + "';window.close();", true);
        }
예제 #17
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_esoppicsFacade == null)
            {
                _esoppicsFacade = new EsopPicsFacade(base.DataProvider);
            }
            this.DataProvider.BeginTransaction();
            Esoppics pic = (Esoppics)domainObject;

            object[] items = _esoppicsFacade.CheckEsoppicExist((Esoppics)domainObject);
            if (items != null && items.Length > 0)
            {
                if (items.Length == 1 && ((Esoppics)items[0]).Serial == this.HiddenPicSerial.Text)
                {
                    this._esoppicsFacade.UpdateEsoppics((Esoppics)domainObject);
                    if (UpLoadFile("EDIT", (Esoppics)domainObject))
                    {
                        this.DataProvider.CommitTransaction();
                        WebInfoPublish.PublishInfo(this, "$ReportDesign_Save_Success", this.languageComponent1);
                    }
                    else
                    {
                        this.DataProvider.RollbackTransaction();
                    }
                }
                else
                {
                    WebInfoPublish.PublishInfo(this, "$Error_Primary_Key_Overlap", this.languageComponent1);
                    return;
                }
            }
            else
            {
                this._esoppicsFacade.UpdateEsoppics((Esoppics)domainObject);
                if (UpLoadFile("EDIT", (Esoppics)domainObject))
                {
                    this.DataProvider.CommitTransaction();
                    WebInfoPublish.PublishInfo(this, "$ReportDesign_Save_Success", this.languageComponent1);
                }
                else
                {
                    this.DataProvider.RollbackTransaction();
                }
            }
        }
예제 #18
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(this.lblDNNOOutEdit, this.txtDNNOOutEdit, 40, true));
            manager.Add(new LengthCheck(this.lblLineNOEdit, this.txtLineNOEdit, 6, true));
            manager.Add(new NumberCheck(this.lblTempOutQtyEdit, this.txtTempOutQtyEdit, 0, 999999999, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }

            if (_facade == null)
            {
                _facade = new InventoryFacade(this.DataProvider);
            }
            object[] getObjects = _facade.QueryDNTempOut(this.txtStorageTypeQuery.Text,
                                                         this.txtItemCodeQuery.Text,
                                                         ViewState["MModelCode"].ToString(),
                                                         this.txtStackCodeQuery.Text,
                                                         ViewState["Company"].ToString());

            if (getObjects != null)
            {
                this.txtSAP_REPORTQTY.Text = Convert.ToString(((DNTempOutMessage)getObjects[0]).SAPQTY);
            }

            int allTempQty = 0;

            foreach (UltraGridRow row in this.gridWebGrid.Rows)
            {
                allTempQty = allTempQty + int.Parse(row.Cells[3].Text.ToString().Trim());
            }
            allTempQty = allTempQty + int.Parse(this.txtTempOutQtyEdit.Text.Trim());

            if (allTempQty > int.Parse(this.txtSAP_REPORTQTY.Text.Trim()))
            {
                WebInfoPublish.PublishInfo(this, "$ERROR_CanUseredQty_Must_Over_TempQty", this.languageComponent1);
                return(false);
            }

            return(true);
        }
예제 #19
0
        protected void cmdCheck_ServerClick(object sender, EventArgs e)
        {
            if (_InventoryFacade == null)
            {
                _InventoryFacade = new InventoryFacade(base.DataProvider);
            }
            if (this.gridWebGrid.Rows.Count == 0)
            {
                //提示错误
                WebInfoPublish.PublishInfo(this, "Grid中没有数据", this.languageComponent1);
                return;
            }
            List <AsnHead> obj = _InventoryFacade.QueryASNDetailSNCatron(this.txtCartonnoSN.Text.Trim());


            string stNO   = "";
            string stLine = "";

            if (obj != null)
            {
                for (int i = 0; i < this.gridWebGrid.Rows.Count; i++)
                {
                    this.gridWebGrid.Rows[i].Items.FindItemByKey("Check").Value = false;
                }
                foreach (AsnHead o in obj)
                {
                    for (int i = 0; i < this.gridWebGrid.Rows.Count; i++)
                    {
                        stNO   = this.gridWebGrid.Rows[i].Items.FindItemByKey("ASN").Text;
                        stLine = this.gridWebGrid.Rows[i].Items.FindItemByKey("stline").Text;

                        if ((o.STNO == stNO && (o.STlINE == stLine)))
                        {
                            this.gridWebGrid.Rows[i].Items.FindItemByKey("Check").Value = true;
                        }
                    }
                }
            }
            else
            {
                //提示没找到相关信息
                WebInfoPublish.PublishInfo(this, "没有匹配入库指令号信息", this.languageComponent1);
                return;
            }
        }
예제 #20
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.EquipmentFacade(this.DataProvider);
            }
            foreach (Domain.Equipment.EquipmentType epqType in domainObjects)
            {
                int count = _facade.QueryEquipmentCountByType(epqType.Eqptype);
                if (count > 0)
                {
                    WebInfoPublish.PublishInfo(this, "$EQPTYPE_CONNOT_DELETE $EQPTYPE:" + epqType.Eqptype, this.languageComponent1);
                    return;
                }
            }

            this._facade.DeleteEquipmentType((Domain.Equipment.EquipmentType[])domainObjects.ToArray(typeof(Domain.Equipment.EquipmentType)));
        }
예제 #21
0
        protected override void AddDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new InventoryFacade(this.DataProvider);
            }

            DNTempOut      dnTempOut      = domainObject as DNTempOut;
            DeliveryFacade deliveryFacade = new DeliveryFacade(this.DataProvider);

            DeliveryNote deliveryNote = (DeliveryNote)deliveryFacade.GetDeliveryNote(dnTempOut.DNNO, dnTempOut.DNLine);

            if (deliveryNote == null)
            {
                WebInfoPublish.PublishInfo(this, "$ERROR_DNNO_And_DNLine_NOT_Exist", this.languageComponent1);
                return;
            }

            if (deliveryNote.DNStatus == DNStatus.StatusClose)
            {
                WebInfoPublish.PublishInfo(this, "$ERROR_DNNO_And_DNLine_Close", this.languageComponent1);
                return;
            }

            if (deliveryNote.ItemCode.Trim().ToUpper() != this.txtItemCodeQuery.Text.Trim().ToUpper())
            {
                WebInfoPublish.PublishInfo(this, "$ERROR_DNNO_And_DNLine_ItemCode", this.languageComponent1);
                return;
            }

            object getDNTempOut = _facade.GetDNTempOut(dnTempOut.StackCode, dnTempOut.ItemCode, dnTempOut.DNNO, dnTempOut.DNLine);

            if (getDNTempOut != null)
            {
                WebInfoPublish.PublishInfo(this, "$ERROR_DNNO_And_DNLine_Temped", this.languageComponent1);
                return;
            }

            _facade.AddDNTempOut(dnTempOut);

            //this.txtSAP_REPORTQTY.Text = Convert.ToString(int.Parse(this.txtCanUseredQtyQuery.Text.Trim()) - int.Parse(this.txtTempOutQtyEdit.Text.Trim()));

            this.RequestData();
        }
예제 #22
0
 //供应商代码下拉框
 /// <summary>
 /// 供应商代码下拉框
 /// </summary>
 private void InitVendorCodeList()
 {
     if (_SystemSettingFacade == null)
     {
         _SystemSettingFacade = new SystemSettingFacade(base.DataProvider);
     }
     object[] parameters = _SystemSettingFacade.GetParametersByParameterGroup("VENDORCODE");
     if (parameters == null)
     {
         WebInfoPublish.PublishInfo(this, "请先配置供应商代码", this.languageComponent1);
         // WebInfoPublish.Publish(this, "$Error_ASN_NO_DATA", this.languageComponent1);
         return;
     }
     this.drpVendorCodeEdit.Items.Add(new ListItem("", ""));
     foreach (Domain.BaseSetting.Parameter parameter in parameters)
     {
         this.drpVendorCodeEdit.Items.Add(new ListItem(parameter.ParameterDescription, parameter.ParameterAlias));
     }
     this.drpVendorCodeEdit.SelectedIndex = 0;
 }
예제 #23
0
        protected void cmdIQCReceive_ServerClick(object sender, System.EventArgs e)
        {
            MaterialReceive materialReceive = (MaterialReceive)this.GetEditObject();

            if (materialReceive != null)
            {
                string returnMessage = string.Empty;
                if (IQCReceive(materialReceive, ref returnMessage))
                {
                    this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                    this.RequestData();
                    this.buttonHelper.PageActionStatusHandle(PageActionType.Save);

                    WebInfoPublish.PublishInfo(this, "$Message_IQCReceiveOK", languageComponent1);
                }
                else
                {
                    WebInfoPublish.Publish(this, "$Message_IQCReceiveFailed" + " : " + returnMessage, languageComponent1);
                }
            }
        }
예제 #24
0
        protected void txtItemEdit_TextChanged(object sender, EventArgs e)
        {
            //-------Add by DS22 / Crane.Liu 2014-02-27 Start--------------
            /// Description:
            /// 编辑一个钢板,编辑产品,把所有选择产品移除,然后保存,退回到钢板编辑页面时,系统报错。
            /// 因为返回时要得到联板数,没选产品就没有得到联板数,所以报错
            if (string.IsNullOrEmpty(this.txtItemEdit.Text.Trim()))
            {
                return;
            }
            //-------Add by DS22 / Crane.Liu 2014-02-27 End----------------
            string[] items  = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemEdit.Text)).Split(',');
            string   LBRate = string.Empty;

            if (items.Length > 0)
            {
                ItemFacade itemFacade;
                foreach (string item in items)
                {
                    itemFacade = new ItemFacade();
                    object obj = itemFacade.GetItem(item, GlobalVariables.CurrentOrganizations.First().OrganizationID);
                    if (String.IsNullOrEmpty(LBRate))
                    {
                        LBRate = ((Item)obj).PcbaCount.ToString("##.##");
                    }
                    else
                    {
                        if (LBRate != ((Item)obj).PcbaCount.ToString("##.##"))
                        {
                            WebInfoPublish.PublishInfo(this, "$message_Item_PcbaCount_Not_Same", languageComponent1);
                            this.txtItemEdit.Text   = string.Empty;
                            this.txtLBRateEdit.Text = string.Empty;
                            return;
                        }
                    }
                }
            }
            this.txtLBRateEdit.Text = LBRate;
        }
예제 #25
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.EquipmentFacade(base.DataProvider);
            }

            this.DataProvider.BeginTransaction();
            try
            {
                foreach (Domain.Equipment.Equipment obj in domainObjects)
                {
                    // 1. 该设备ID在设备维修日志(TBLEQPTSLOG)中状态为New的不允许删除。
                    // s2. 设备保养计划(TBLEQPMaintenance)存在该设备ID也不允许删除。

                    int tsLogCount = this._facade.CheckEQPTSLogExists(obj.EqpId, EquipmentTSLogStatus.EquipmentTSLogStatus_New);
                    if (tsLogCount > 0)
                    {
                        this.DataProvider.RollbackTransaction();
                        WebInfoPublish.PublishInfo(this, "$EQPID_TSLOG_CONNOT_DELETE $EQPID:" + obj.EqpId, this.languageComponent1);
                        return;
                    }

                    int maintenanceCount = this._facade.QueryEQPMaintenanceCount(obj.EqpId, "", "");
                    if (maintenanceCount > 0)
                    {
                        this.DataProvider.RollbackTransaction();
                        WebInfoPublish.PublishInfo(this, "$EQPID_EQPMaintenance_CONNOT_DELETE $EQPID:" + obj.EqpId, this.languageComponent1);
                        return;
                    }
                    this._facade.DeleteEquipment(obj);
                }
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
            }
            this.DataProvider.CommitTransaction();
        }
예제 #26
0
        private bool ValidateInputForCreateIQCByASN()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblReceiptNOEdit, txtASNEdit, 40, true));

            if (!manager.Check())
            {
                WebInfoPublish.PublishInfo(this, manager.CheckMessage, languageComponent1);
                return(false);
            }

            ASN asn = (ASN)_IQCFacade.GetASN(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtASNEdit.Text)));

            if (asn != null)
            {
                WebInfoPublish.PublishInfo(this, "$Error_ReceiptNOHasBeenDealed", languageComponent1);
                return(false);
            }

            return(true);
        }
예제 #27
0
        protected void cmdCheck_ServerClick(object sender, EventArgs e)
        {
            if (_DocumentFacade == null)
            {
                _DocumentFacade = new DocumentFacade(base.DataProvider);
            }


            if (gridHelper == null)
            {
                gridHelper = new GridHelperNew(this.gridWebGrid, this.DtSource);
            }

            try
            {
                if (!_DocumentFacade.GetDocDirRight(int.Parse(this.txtDocDirQuery.Text.Trim()), this.GetUserCode(), "CHECK"))
                {
                    WebInfoPublish.PublishInfo(this, "$Error_No_CheckFile_Right", this.languageComponent1);
                    return;
                }
                this.DataProvider.BeginTransaction();
                foreach (object obj in gridHelper.GetCheckedRows())
                {
                    int serial = int.Parse((obj as GridRecord).Items.FindItemByKey("DOCSERIAL").Value.ToString());
                    Doc doc    = (Doc)_DocumentFacade.GetDOC(serial);
                    doc.Checkedstatus = "Y";
                    _DocumentFacade.UpdateDOC(doc);
                }
                this.DataProvider.CommitTransaction();
                this.gridHelper.RefreshData();
                WebInfoPublish.PublishInfo(this, "$Success_Check", this.languageComponent1);
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                WebInfoPublish.PublishInfo(this, "$Error_Check_Exception", this.languageComponent1);
            }
        }
예제 #28
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_facade == null)
            {
                _facade = new DocumentFacade(base.DataProvider);
            }

            this.DataProvider.BeginTransaction();
            try
            {
                foreach (DocDir obj in domainObjects)
                {
                    if (_facade.CheckHasSubDIR(obj.Dirserial))
                    {
                        this.DataProvider.RollbackTransaction();
                        WebInfoPublish.PublishInfo(this, "$Message_Has_SubDIR", languageComponent1);

                        return;
                    }
                    if (_facade.CheckHasDocuments(obj.Dirserial))
                    {
                        this.DataProvider.RollbackTransaction();
                        WebInfoPublish.PublishInfo(this, "$Message_Has_Documents", languageComponent1);
                        return;
                    }

                    this._facade.DeleteDOCDIR(obj);
                    this._facade.DeleteDocdir2UserGroupByDIRSerial(obj.Dirserial);
                }
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
            }
            this.DataProvider.CommitTransaction();

            BuildDocumentTree(true);
        }
예제 #29
0
        private bool CheckGridValue()
        {
            decimal   materialNumber = 0;
            ArrayList rowList        = this.gridHelper.GetCheckedRows();

            foreach (UltraGridRow row in rowList)
            {
                if (string.IsNullOrEmpty(row.Cells[11].Text))
                {
                    WebInfoPublish.PublishInfo(this, "$ERROR_TransNumber_Cannot_Be_Empty", this.languageComponent1);
                    return(false);
                }


                if (Convert.ToDecimal(row.Cells[11].Text.Trim()) < 0)
                {
                    WebInfoPublish.PublishInfo(this, "$ERROR_TransNumber_Must_Be_OVER_ZERRO", this.languageComponent1);
                    return(false);
                }

                if (Convert.ToDecimal(row.Cells[10].Text.Trim()) < Convert.ToDecimal(row.Cells[11].Text.Trim()))
                {
                    WebInfoPublish.PublishInfo(this, "$ERROR_TransNumber_Cannot_Bigger_RemainNumber", this.languageComponent1);
                    return(false);
                }

                materialNumber += Convert.ToDecimal(row.Cells[11].Text.Trim());
            }

            if (materialNumber > Convert.ToDecimal(this.txtLactQty.Text.Trim()))
            {
                WebInfoPublish.PublishInfo(this, "$ERROR_TransNumber_Cannot_Bigger_LackNumber", this.languageComponent1);
                return(false);
            }

            return(true);
        }
예제 #30
0
        protected void InitialObjects(object[] barList)
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new WarehouseFacade(base.DataProvider);
            }

            try
            {
                this.DataProvider.BeginTransaction();
                foreach (BarCode bar in barList)
                {
                    bar.PrintTimes = bar.PrintTimes + 1;
                    _WarehouseFacade.UpdateBarCode(bar);
                }
                // Page.RegisterClientScriptBlock("Print", "<script>Print()</script>");
                this.DataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                WebInfoPublish.PublishInfo(this, ex.Message, this.languageComponent1);
            }
        }