コード例 #1
0
        private void Delete()
        {
            try
            {
                if (CPMMaster.MEMBER.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Member"));
                    return;
                }

                if (CPMMaster.DEPT.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Department"));
                    return;
                }
                MessageBoxResult messageBoxResult = ShowWarningMessage(PDMsg.BeforeDelete("Member"), MessageBoxButton.YesNo);
                //System.Windows.MessageBox.Show("Do you want to delete this Member?", ApplicationTitle, System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    if (_cpmTitleBll.DeleteCpmTitle(CPMMaster.DEPT, CPMMaster.MEMBER))
                    {
                        ShowInformationMessage(PDMsg.DeletedSuccessfully);
                        CPMMaster.DEPT   = "";
                        CPMMaster.MEMBER = "";
                        CPMMaster.CPMDeptMasterDetails = _cpmTitleBll.GetCPMMasterDeptList();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #2
0
 private void Delete()
 {
     try
     {
         if (!CategoryModel.Category.IsNotNullOrEmpty())
         {
             ShowInformationMessage(PDMsg.NotEmpty("Category"));
             FocusButton = true;
             return;
         }
         MessageBoxResult messageBoxResult = ShowWarningMessage(PDMsg.BeforeDelete("Category"), MessageBoxButton.YesNo);
         if (messageBoxResult == MessageBoxResult.Yes)
         {
             //Progress.Start();
             if (categoryBll.DeletePswApplication(CategoryModel.Category))
             {
                 //Progress.End();
                 ShowInformationMessage(PDMsg.DeletedSuccessfully);
                 FocusButton                = true;
                 CategoryModel.Category     = string.Empty;
                 CategoryModel.CategoryView = categoryBll.GetCategory();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex.LogException();
     }
 }
コード例 #3
0
        private void Print()
        {
            if (!CostSheet.PART_NO.IsNotNullOrEmpty())
            {
                MessageBox.Show(PDMsg.NotEmpty("Part No"), ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            if (!CostSheet.ROUTE_NO.IsNotNullOrEmpty())
            {
                MessageBox.Show(PDMsg.NotEmpty("Process No"), ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }


            if (CostSheet.DVCostSheet == null || CostSheet.DVCostSheet.Count == 0)
            {
                ShowInformationMessage(PDMsg.NoRecordsPrint);
            }
            else
            {
                DataSet processData = new DataSet();
                processData.Tables.Add(CostSheet.DVCostSheet.ToTable("CostSheet"));
                processData.Tables.Add(CostSheetDetails());
                //processData.WriteXmlSchema(@"E:\CostSheet.xml");
                frmReportViewer rv = new frmReportViewer(processData, "CostSheet");
                rv.ShowDialog();
            }
        }
コード例 #4
0
        private void qcpReport()
        {
            //SelectDataRowPart();

            if (!QCPMODEL.PartNo.IsNotNullOrEmpty())
            {
                ShowInformationMessage(PDMsg.NotEmpty("Part No"));
                //ShowInformationMessage("Part No does not exists"); // Jeyan
                return;
            }
            else
            {
                DataTable processData;
                processData = qcpBll.GetQCP(PccsModel, QCPMODEL);
                if (processData == null || processData.Rows.Count == 0)
                {
                    ShowInformationMessage(PDMsg.NoRecordsPrint);
                }
                else
                {
                    frmReportViewer rv = new frmReportViewer(processData, "QCP");
                    rv.ShowDialog();
                }
            }
        }
コード例 #5
0
 private void Delete()
 {
     try
     {
         if (!ApplicationModel.PSWApplication.IsNotNullOrEmpty())
         {
             ShowInformationMessage(PDMsg.NotEmpty("Application"));
             FocusButton = true;
             return;
         }
         MessageBoxResult messageBoxResult = ShowWarningMessage(PDMsg.BeforeDelete("Application"), MessageBoxButton.YesNo);
         if (messageBoxResult == MessageBoxResult.Yes)
         {
             //Progress.Start();
             if (applicationBll.DeletePswApplication(ApplicationModel.PSWApplication))
             {
                 //Progress.End();
                 ShowInformationMessage(PDMsg.DeletedSuccessfully);
                 FocusButton = true;
                 ApplicationModel.PSWApplication     = string.Empty;
                 ApplicationModel.PSWApplicationView = applicationBll.GetApplication();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex.LogException();
     }
 }
コード例 #6
0
        private void ciReferenceEndEdit()
        {
            if (!OldActiveEntity.IsNotNullOrEmpty())
            {
                return;
            }
            if (!OldActiveEntity.CI_REFERENCE.IsNotNullOrEmpty())
            {
                return;
            }
            string message;

            if (!bll.IsValidCIReferenceNumber(OldActiveEntity, ActionMode, out message) && message.IsNotNullOrEmpty() &&
                !(message.IndexOf("already exists") >= 0))
            {
                return;
            }
            if (!message.IsNotNullOrEmpty())
            {
                OldActiveEntity.IDPK = -99999;
                string tmpCI = OldActiveEntity.CI_REFERENCE;
                //ClearAll();
                OldActiveEntity.CI_REFERENCE = tmpCI;
                OldCIReferenceSelectedRow    = null;
                ShowInformationMessage(PDMsg.DoesNotExists("CI Reference"));
                return;
            }
        }
コード例 #7
0
ファイル: APQPViewModel.cs プロジェクト: amuthagan/Invoic
 private void PrintReport()
 {
     try
     {
         DataTable dtData;
         string    reportName = "APQPReport";
         if (!PartNo.IsNotNullOrEmpty())
         {
             ShowInformationMessage(PDMsg.NotEmpty("Part No"));
             return;
         }
         dtData = DvAPQP.ToTable().Copy();
         //dtData.Rows.Clear();
         DataSet dsReport = new DataSet();
         dsReport.DataSetName = "DSAPQPDATA";
         //dtData.Rows.Clear();
         dsReport.Namespace = "APQP";
         dtData.TableName   = "APQP";
         dsReport.Tables.Add(dtData);
         //dsReport.WriteXml("E:\\APQP.xml", XmlWriteMode.WriteSchema);
         Dictionary <string, string> dictFormula = new Dictionary <string, string>();
         dictFormula.Add("PartNo", "SFL Part No : " + PartNo);
         frmReportViewer reportViewer = new frmReportViewer(dsReport, reportName, CrystalDecisions.Shared.ExportFormatType.NoFormat, dictFormula);
         if (!reportViewer.ReadyToShowReport)
         {
             return;
         }
         reportViewer.ShowDialog();
     }
     catch (Exception ex)
     {
         throw ex.LogException();
     }
 }
コード例 #8
0
ファイル: APQPViewModel.cs プロジェクト: amuthagan/Invoic
 private void Save()
 {
     try
     {
         if (!PartNo.IsNotNullOrEmpty())
         {
             ShowInformationMessage(PDMsg.NotEmpty("Part No"));
             return;
         }
         PartNumberIsFocused  = true;
         Mouse.OverrideCursor = Cursors.Wait;
         DvAPQP.ToTable().AcceptChanges();
         if (_aPQPBll.Save(DvAPQP.ToTable().Copy(), PartNo) == true)
         {
             Mouse.OverrideCursor = null;
             ShowInformationMessage(PDMsg.UpdatedSuccessfully);
             // ClearAll();
         }
     }
     catch (Exception ex)
     {
         throw ex.LogException();
     }
     finally
     {
         Mouse.OverrideCursor = null;
     }
 }
コード例 #9
0
        public void Save()
        {
            try
            {
                if (SecurityUsers.Mode == "I" || SecurityUsers.Mode == "U")
                {
                    if (SecurityUsers.UserName.ToString() == "")
                    {
                        ShowInformationMessage(PDMsg.NotEmpty("User Name"));
                        //MessageBox.Show("User Name should not be empty.", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    if (SecurityUsers.Password.ToString() == "")
                    {
                        ShowInformationMessage(PDMsg.NotEmpty("Password"));
                        //MessageBox.Show("Password should not be empty.", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    _securityUserBll.UpdateSecurityUsers(SecurityUsers);
                    if (SecurityUsers.Status != "")
                    {
                        _selectedItem.BeginEdit();
                        _selectedItem.Row["USER_NAME"]   = SecurityUsers.UserName;
                        _selectedItem.Row["FULL_NAME"]   = SecurityUsers.FullName;
                        _selectedItem.Row["DESIGNATION"] = SecurityUsers.Designation;
                        _selectedItem.Row["IS_ADMIN"]    = SecurityUsers.IsAdmin;
                        _selectedItem.Row["PASSWORD"]    = "******";
                        _selectedItem.EndEdit();
                        MessageBox.Show(SecurityUsers.Status, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        if (SecurityUsers.Status != "Given user already exist.")
                        {
                            if (_closed == false)
                            {
                                _closed = true;
                                CloseAction();
                            }
                        }
                        if (_closed == false)
                        {
                            _closed = true;
                            CloseAction();
                        }
                    }
                }
                else if (SecurityUsers.Mode == "D")
                {
                    _securityUserBll.UpdateSecurityUsers(SecurityUsers);
                    if (SecurityUsers.Status != "")
                    {
                        MessageBox.Show(SecurityUsers.Status, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #10
0
 private void UpdateFeature()
 {
     if (String.IsNullOrEmpty(ExistingFeatureUpdate))
     {
         Message = PDMsg.NotEmpty("Feature Name");
     }
     else if (String.IsNullOrEmpty(NewFeature))
     {
         Message = PDMsg.NotEmpty("New Feature Name");
     }
     else
     {
         if (featureUpdate.FeatureAddDuplicate(NewFeature))
         {
             bool val = featureUpdate.updateFeatureUpdateMaster(ExistingFeatureUpdate, NewFeature);
             if (val)
             {
                 Message = PDMsg.UpdatedSuccessfully;
                 ClearFeature();
                 this.DVFeature = featureUpdate.GetFeatureUpdateMaster();
                 LoadFormData();
             }
         }
         else
         {
             ShowInformationMessage(PDMsg.AlreadyExists("Feature Name"));
         }
     }
 }
コード例 #11
0
        private void RefreshData()
        {
            try
            {
                int cnt = 0;
                if (SelectedUser == null)
                {
                    return;
                }
                if (ReportCode.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Report Option"));
                    return;
                }

                if (StartDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Start Date"));
                    return;
                }

                if (EndDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("End Date"));
                    return;
                }

                if (StartDate > EndDate)
                {
                    ShowInformationMessage("Start Date is Greater than End Date,Please Check it.!");
                    return;
                }

                //ReportData = _flxReportsBll
                if (ReportCode == "PPAP") //PPAP Submitted
                {
                    ReportData = _flxReportsBll.PPAPSubmitted(SelectedUser.USER_NAME.ToUpper().Trim(), Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"));
                }
                else if (ReportCode == "DR") //Document Released
                {
                    ReportData = _flxReportsBll.DocumentReleased(SelectedUser.USER_NAME.ToUpper().Trim(), Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"));
                }
                else if (ReportCode == "PNA") //part Nos Allotted
                {
                    ReportData = _flxReportsBll.PartNoAllotted(SelectedUser.USER_NAME.ToUpper().Trim(), Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"));
                }
                cnt           = ReportData.Count;
                HeaderDetails = "Designers - " + SelectedUser.FULL_NAME + " - " + cnt.ToString() + (cnt > 0 ? " Entries" : " Entry") + " found ";
                //if (ReportData.Count == 0)
                //{
                //    ShowInformationMessage("No Entries Found!");
                //}
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #12
0
        private void Save()
        {
            try
            {
                if (SaveButtonIsEnable == false)
                {
                    return;
                }
                if (PSWTitleMaster.PSWName.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Name"));
                    FocusButtonName = true;
                    FocusButton     = false;
                    return;
                }

                //if (PSWTitleMaster.PSWTitle.Trim().Length <= 0)
                //{
                //    MessageBox.Show(PDMsg.NotEmpty("Title"));
                //    return;
                //}
                PSWTitleMaster.IsActive = (IsActive) ? false : true;
                string typ = "";
                //Progress.ProcessingText = PDMsg.ProgressUpdateText;
                //Progress.Start();

                if (_pswTitleBll.SavePswMasterTitle(PSWTitleMaster, PSWTitleMaster.PSWName, PSWTitleMaster.PSWTitle, EditButtonIsEnable, ref typ))
                {
                    //Progress.End();
                    ShowInformationMessage(typ);
                    FocusButtonName = true;
                    //FocusButton = false;
                    //PSWTitleMaster.PSWTitle = string.Empty;
                    //PSWTitleMaster.PSWName = string.Empty;
                    PSWTitleMaster.PSWTitleMasterDetails = _pswTitleBll.GetPswNameList();
                    //_operationmode = OperationMode.Save;
                    //ButtonVisibleName = Visibility.Collapsed;
                    //AddButtonIsEnable = false;
                    //DeleteButtonIsEnable = false;
                    //EditButtonIsEnable = true;
                    //IsNameReadonly = false;
                    //IsVisibilityDelete = Visibility.Visible;
                    //IsActive = true;
                    //IsDeleteEnable = false;
                    //setRights();
                }
                else
                {
                    Progress.End();
                    ShowInformationMessage(typ);
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #13
0
        private void RefreshSubmitCommand()
        {
            if (StartDate.ToValueAsString().Trim() == "")
            {
                ShowInformationMessage(PDMsg.NotEmpty("Start Date"));
                return;
            }
            if (EndDate.ToValueAsString().Trim() == "")
            {
                ShowInformationMessage(PDMsg.NotEmpty("End Date"));
                return;
            }
            if (StartDate > EndDate)
            {
                ShowInformationMessage("Start Date is Greater than End Date,Please Check it.!");
                return;
            }
            PRD_MAST productMaster = new PRD_MAST()
            {
                PART_NO = MandatoryFields.PART_NO
            };
            DDCI_INFO customerInfo = null;

            DataSet dsReport = bll.GetAllMFM(Convert.ToDateTime(StartDate).ToString("MM/dd/yyyy"), Convert.ToDateTime(EndDate).ToString("MM/dd/yyyy"), productMaster, customerInfo, DDCUST_MAST);

            MandatoryFields.GRID_TITLE = REPORT_TITLE;
            //for (int i = 0; i < dsReport.Tables[0].Rows.Count; i++)
            //{
            //    string date = Convert.ToDateTime(dsReport.Tables[0].Rows[i]["DOC_REL_DT_PLAN"].ToString()).ToShortDateString();
            //}
            foreach (DataRow dr in dsReport.Tables[0].Rows)
            {
                dr["DOC_REL_DT_PLAN"]        = string.IsNullOrEmpty(dr["DOC_REL_DT_PLAN"].ToString()) ? null : DateTime.Parse((dr["DOC_REL_DT_PLAN"].ToString())).ToString("dd/MM/yyyy");
                dr["DOC_REL_DT_ACTUAL"]      = string.IsNullOrEmpty(dr["DOC_REL_DT_ACTUAL"].ToString()) ? null : DateTime.Parse((dr["DOC_REL_DT_ACTUAL"].ToString())).ToString("dd/MM/yyyy");
                dr["TOOLS_READY_DT_PLAN"]    = string.IsNullOrEmpty(dr["TOOLS_READY_DT_PLAN"].ToString()) ? null : DateTime.Parse((dr["TOOLS_READY_DT_PLAN"].ToString())).ToString("dd/MM/yyyy");
                dr["TOOLS_READY_ACTUAL_DT"]  = string.IsNullOrEmpty(dr["TOOLS_READY_ACTUAL_DT"].ToString()) ? null : DateTime.Parse((dr["TOOLS_READY_ACTUAL_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["FORGING_PLAN_DT"]        = string.IsNullOrEmpty(dr["FORGING_PLAN_DT"].ToString()) ? null : DateTime.Parse((dr["FORGING_PLAN_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["FORGING_ACTUAL_DT"]      = string.IsNullOrEmpty(dr["FORGING_ACTUAL_DT"].ToString()) ? null : DateTime.Parse((dr["FORGING_ACTUAL_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["SECONDARY_PLAN_DT"]      = string.IsNullOrEmpty(dr["SECONDARY_PLAN_DT"].ToString()) ? null : DateTime.Parse((dr["SECONDARY_PLAN_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["SECONDARY_ACTUAL_DT"]    = string.IsNullOrEmpty(dr["SECONDARY_ACTUAL_DT"].ToString()) ? null : DateTime.Parse((dr["SECONDARY_ACTUAL_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["HEAT_TREATMENT_PLAN_DT"] = string.IsNullOrEmpty(dr["HEAT_TREATMENT_PLAN_DT"].ToString()) ? null : DateTime.Parse((dr["HEAT_TREATMENT_PLAN_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["HEAT_TREATMENT_ACTUAL"]  = string.IsNullOrEmpty(dr["HEAT_TREATMENT_ACTUAL"].ToString()) ? null : DateTime.Parse((dr["HEAT_TREATMENT_ACTUAL"].ToString())).ToString("dd/MM/yyyy");
                dr["ISSR_PLAN_DT"]           = string.IsNullOrEmpty(dr["ISSR_PLAN_DT"].ToString()) ? null : DateTime.Parse((dr["ISSR_PLAN_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["ISSR_ACTUAL_DT"]         = string.IsNullOrEmpty(dr["ISSR_ACTUAL_DT"].ToString()) ? null : DateTime.Parse((dr["ISSR_ACTUAL_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["PPAP_PLAN"]      = string.IsNullOrEmpty(dr["PPAP_PLAN"].ToString()) ? null : DateTime.Parse((dr["PPAP_PLAN"].ToString())).ToString("dd/MM/yyyy");
                dr["PPAP_ACTUAL_DT"] = string.IsNullOrEmpty(dr["PPAP_ACTUAL_DT"].ToString()) ? null : DateTime.Parse((dr["PPAP_ACTUAL_DT"].ToString())).ToString("dd/MM/yyyy");
                dr["PSW_DATE"]       = string.IsNullOrEmpty(dr["PSW_DATE"].ToString()) ? null : DateTime.Parse((dr["PSW_DATE"].ToString())).ToString("dd/MM/yyyy");
            }
            if (!dsReport.IsNotNullOrEmpty() || !dsReport.Tables.IsNotNullOrEmpty() || dsReport.Tables.Count <= 0)
            {
                return;
            }

            MandatoryFields.GridData   = dsReport.Tables[0].DefaultView;
            MandatoryFields.GRID_TITLE = REPORT_TITLE + " - " + MandatoryFields.GridData.Table.Rows.Count + " Entries";
        }
コード例 #14
0
        private void Save()
        {
            try
            {
                string status = "";
                if (EcnCftMeetingRptModel.PartNo.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("PartNo"));
                    FocusButton = true;
                    return;
                }
                if (EcnCftMeetingRptModel.PPAPSampleQty.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("SampleQty"));
                    return;
                }
                else if (EcnCftMeetingRptModel.CFTMeetingIssueNo.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Issue Number"));
                    return;
                }
                else if (EcnCftMeetingRptModel.CFTMeetingDate == null)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("ECN-CFT Meeting Date"));
                    return;
                }

                Progress.ProcessingText = PDMsg.ProgressUpdateText;
                Progress.Start();

                if (_bll.SaveCFTMeeting(EcnCftMeetingRptModel, ref status))
                {
                    Progress.End();

                    // InitLoad();
                }

                IsEnabledPrint = true;

                if (status == "INS")
                {
                    ShowInformationMessage(PDMsg.SavedSuccessfully);
                }
                else
                {
                    ShowInformationMessage(PDMsg.UpdatedSuccessfully);
                }
                Progress.End();
            }
            catch (Exception ex)
            {
                Progress.End();
                ex.LogException();
            }
            FocusButton = true;
        }
コード例 #15
0
        /// <summary>
        /// This method is used to save the roles;
        /// </summary>
        private void SaveRoles()
        {
            try
            {
                if (Sec_Roles_Master.ROLE_NAME.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Role name"));
                    //MessageBox.Show("Role name cannot be empty", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
                Sec_Roles_Master.ROLE_NAME = Sec_Roles_Master.ROLE_NAME.ToValueAsString().Trim();
                if (_usrroledet.CheckDuplicate(Sec_Roles_Master, _mode) == false)
                {
                    Progress.ProcessingText = PDMsg.ProgressUpdateText;
                    Progress.Start();

                    if (_usrroledet.SaveRoles(Sec_Roles_Master, _mode) == true)
                    {
                        if (selecteditem != null)
                        {
                            selecteditem["ROLE_NAME"] = Sec_Roles_Master.ROLE_NAME.Trim();
                        }
                        Progress.End();
                        if (_mode == OperationMode.AddNew)
                        {
                            ShowInformationMessage(PDMsg.SavedSuccessfully);
                        }
                        else
                        {
                            ShowInformationMessage(PDMsg.UpdatedSuccessfully);
                        }
                        //MessageBox.Show("The Role was saved successfully", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        if (_closed == false)
                        {
                            _closed = true;
                            CloseAction();
                        }
                    }
                    else
                    {
                        Progress.End();
                        MessageBox.Show("The Role could not be Saved", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
                else
                {
                    ShowInformationMessage(PDMsg.AlreadyExists("Role"));
                    //MessageBox.Show("Role already exists", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #16
0
        private void Save()
        {
            try
            {
                if (SaveButtonIsEnable == false)
                {
                    return;
                }
                if (!ApplicationModel.PSWApplication.IsNotNullOrEmpty())
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Application"));
                    FocusButton = true;
                    return;
                }
                else if (!applicationBll.ApplicationAddDuplicate(ApplicationModel))
                {
                    ShowInformationMessage(PDMsg.AlreadyExists("Application"));
                    FocusButton = true;
                    return;
                }
                //else if (!applicationBll.ApplicationEditDuplicate(ApplicationModel) && EditButtonIsEnable == false)
                //{
                //    ShowInformationMessage(PDMsg.AlreadyExists("Application"));
                //    FocusButton = true;
                //    return;
                //}

                string mode = "";
                ApplicationModel.Active = (Active) ? false : true;
                //Progress.Start();
                if (applicationBll.AddEditApplication(ApplicationModel, ref mode))
                {
                    if (mode == "Add")
                    {
                        //Progress.End();
                        ShowInformationMessage(PDMsg.SavedSuccessfully);
                        FocusButton = true;
                    }
                    else
                    {
                        Progress.End();
                        ShowInformationMessage(PDMsg.UpdatedSuccessfully);
                        FocusButton = true;
                    }
                    ApplicationModel.PSWApplication = string.Empty;
                    ApplicationFocus = true;
                    Add();
                }
            }
            catch (Exception e)
            {
                throw e.LogException();
            }
        }
コード例 #17
0
        private void PrintCommand()
        {
            if (!TFCMODEL.PartNo.IsNotNullOrEmpty() || !TFCMODEL.ROUTENO.IsNotNullOrEmpty())
            {
                ShowInformationMessage(PDMsg.NotEmpty("Part No and Process No"));
                return;
            }
            else
            {
                DataTable dt;
                GridValues();
                dt = tfcbll.GetPrint(TFCMODEL);

                if (dt == null || dt.Rows.Count == 0)
                {
                    ShowInformationMessage(PDMsg.NoRecordsPrint);
                }
                else
                {
                    if (!dt.Columns.Contains("PCR_NO"))
                    {
                        dt.Columns.Add("PCR_NO", typeof(string));
                    }

                    if (!dt.Columns.Contains("PCR_DATE"))
                    {
                        dt.Columns.Add("PCR_DATE", typeof(DateTime));
                    }

                    if (dt.Columns.Contains("PCR_NO") && dt.Columns.Contains("PCR_DATE"))
                    {
                        try
                        {
                            dt.Rows[0]["PCR_NO"] = TFCMODEL.PCR_NO;
                            if (TFCMODEL.PCR_DATE != null)
                            {
                                dt.Rows[0]["PCR_DATE"] = TFCMODEL.PCR_DATE;
                            }
                        }
                        catch (Exception ex)
                        {
                            ex.LogException();
                        }
                    }
                    frmReportViewer frmrv = new frmReportViewer(dt, "TFC-PCR");
                    frmrv.ShowDialog();
                }
            }
        }
コード例 #18
0
ファイル: ECNPCNViewModel.cs プロジェクト: amuthagan/Invoic
        private void Refresh()
        {
            string startDate;
            string endDate;
            Int64  cnt = 0;

            try
            {
                if (StartDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Start Date"));
                    return;
                }

                if (StartDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("End Date"));
                    return;
                }

                if (StartDate > EndDate)
                {
                    ShowInformationMessage("Start Date is Greater than End Date,Please Check it.!");
                    return;
                }
                startDate = Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy");
                endDate   = Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy");

                if (ECNOrPCN == "PCN")
                {
                    ECNPCNResult = _eCNPCNBll.GetPCNDetails(startDate, endDate);
                }
                else
                {
                    ECNPCNResult = _eCNPCNBll.GetECNDetails(startDate, endDate);
                }
                cnt           = ECNPCNResult.Count;
                HeaderDetails = ECNOrPCN + " Details - " + cnt.ToString() + (cnt > 0 ? " Entries" : " Entry") + " found ";
                NotifyPropertyChanged("HeaderDetails");
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #19
0
        private void Save()
        {
            try
            {
                if (!MFMPlan.PART_NO.IsNotNullOrEmpty())
                {
                    MessageBox.Show(PDMsg.NotEmpty("Part No"), ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
                bll.UpdateMFMPlan(MFMPlan);

                ShowInformationMessage(PDMsg.UpdatedSuccessfully);
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #20
0
        private void DeleteSubmitCommand()
        {
            try
            {
                NextAction = "DELETE";

                if (String.IsNullOrEmpty(Convert.ToString(LocCode)))
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Location Code"));
                    FocusButton = true;
                    //MessageBox.Show("Location Code should be Entered", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    MessageBoxResult messageBoxResult = ShowWarningMessage(PDMsg.BeforeDelete("Location code"), MessageBoxButton.YesNo);
                    FocusButton = true;
                    //System.Windows.MessageBox.Show("Do you want to delete this Location code?", ApplicationTitle, System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (messageBoxResult == MessageBoxResult.Yes)
                    {
                        bool val = oLocMaster.DeleteLocationCode(LocCode, NextAction, ref _errMessage);
                        if (val)
                        {
                            ShowInformationMessage(_errMessage);
                            FocusButton = true;
                            //MessageBox.Show(_errMessage, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                            ClearOperMaster();
                        }
                        if (val == false)
                        {
                            if ((string)_errMessage != "")
                            {
                                ShowInformationMessage(_errMessage);
                            }
                            FocusButton = true;
                            //MessageBox.Show(_errMessage, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #21
0
        private void DeleteParameter(object parameters)
        {
            try
            {
                if (ToolAdmin.SelectedParameter != null && ToolAdmin.SelectedParameter["PARAMETER_CD"].IsNotNullOrEmpty())
                {
                    MessageBoxResult msgResult = ShowWarningMessage(PDMsg.BeforeDelete("Parameter ") + ToolAdmin.SelectedParameter[1].ToString(), MessageBoxButton.YesNo);
                    //MessageBox.Show("Do you want to delete Parameter " + ToolAdmin.SelectedParameter[1].ToString(), "SmartPD", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                    if (msgResult == MessageBoxResult.Yes)
                    {
                        string rowid = ToolAdmin.SelectedParameter["ROWID"].ToString();
                        if (rowid.IsNotNullOrEmpty())
                        {
                            ToolAdmin.DTDeletedRecords.ImportRow(ToolAdmin.SelectedParameter.Row);
                        }

                        if (ToolAdmin.SelectedParameter["PARAMETER_CD"].IsNotNullOrEmpty())
                        {
                            Canvas    cv       = (Canvas)parameters;
                            var       children = cv.Children;
                            TextBlock obj      = (from TextBlock child in children where child.Name == ToolAdmin.SelectedParameter["PARAMETER_CD"].ToString() select child).FirstOrDefault();
                            if (obj != null)
                            {
                                cv.Children.Remove(obj);
                            }
                        }

                        ToolAdmin.SelectedParameter.Delete();
                        ShowInformationMessage(PDMsg.DeletedSuccessfully);

                        AddNewRecord();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #22
0
        public void OnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            DataGrid dg         = sender as DataGrid;
            TextBox  tb         = e.EditingElement as TextBox;
            string   columnName = e.Column.SortMemberPath;
            string   rowid      = ((System.Data.DataRowView)(e.Row.Item)).Row["ROWID"].ToString();
            string   parCode    = ((System.Data.DataRowView)(e.Row.Item)).Row["PARAMETER_CD"].ToString();
            string   parName    = ((System.Data.DataRowView)(e.Row.Item)).Row["PARAMETER_NAME"].ToString();

            if (columnName == "PARAMETER_CD")
            {
                if (rowid.IsNotNullOrEmpty() && !parCode.IsNotNullOrEmpty())
                {
                    MessageBox.Show(PDMsg.NotEmpty("Parameter code"), ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    tb.Text = oldParameterCD;
                    return;
                }

                if (parCode.IsNotNullOrEmpty() && parCode.Substring(0, 1).IsNumeric())
                {
                    MessageBox.Show("Parameter code should start with alphabet.", ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    tb.Text = oldParameterCD;
                    return;
                }

                if (parCode.IsNotNullOrEmpty() && CodeIsValid(parCode.ToString()) == false)
                {
                    MessageBox.Show("Parameter code is not valid.", ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    tb.Text = oldParameterCD;
                    return;
                }

                if (IsDuplicateParamCode(parCode))
                {
                    MessageBox.Show("Parameter Code should not be allow dublicate.", ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    tb.Text = oldParameterCD;
                    return;
                }
            }
        }
コード例 #23
0
        private void SaveCommand()
        {
            IsRecordsUpdated = false;

            if (!TFCMODEL.PartNo.IsNotNullOrEmpty())
            {
                ShowInformationMessage(PDMsg.NotEmpty("Part Number"));
            }
            else if ((TFCMODEL.FEASIBLEPRODUCT || TFCMODEL.NOTFEASIBLE) == false)
            {
                ShowInformationMessage(PDMsg.NotEmpty("Conclusion"));
            }
            else
            {
                if (TFCMODEL.FEASIBLEPRODUCT == true)
                {
                    TFCMODEL.CONCLUSION = Convert.ToString("1");
                }
                else if (TFCMODEL.NOTFEASIBLE == true)
                {
                    TFCMODEL.CONCLUSION = Convert.ToString("2");
                }
                GridValues();
                string mode = "";
                bool   val  = tfcbll.AddEditTfc(TFCMODEL, mode);

                IsRecordsUpdated = true;

                if (val == true)
                {
                    ShowInformationMessage(PDMsg.SavedSuccessfully);
                }
                else
                {
                    ShowInformationMessage(PDMsg.UpdatedSuccessfully);
                }
                //Clear();
            }
        }
コード例 #24
0
ファイル: ExhibitViewModel.cs プロジェクト: amuthagan/Invoic
        private void UpdateExhibit()
        {
            if (String.IsNullOrEmpty(ExhibitDetails))
            {
                //Message = "Please select Exhibit Document.";
                Message = PDMsg.NotEmpty("Exhibit Document");
            }
            else if (String.IsNullOrEmpty(ExhibitNumber.Trim()))
            {
                //Message = "Please enter Exhibit Number.";
                Message = PDMsg.NotEmpty("Exhibit Number");
            }
            else
            {
                bool val = exhit.updateExhitbitMaster(ExhibitNumber, ExhibitDetails);
                if (val)
                {
                    Message = PDMsg.UpdatedSuccessfully;
                    ClearExhibit();
                    this.DtDataview = exhit.GetExhibitMaster();
                    LoadFormData();
                }
            }
            //string query = "UPDATE [EXHIBIT_DOC] set [EX_NO]='" + ExhibitNumber + "' WHERE [DOC_NAME]='" + ExhibitDetails + "'";
            //IEnumerable<int> result = userinformation.Dal.SFLPDDatabase.ExecuteQuery<int>(query);
            //MessageBox.Show("Exhibit Updated");
            //Message = "Exhibit Updated";

            //using (SFLPD db = new SFLPD(userinformation.Dal.SFLPDDatabase.Connection))
            //{
            //    IEnumerable<int> result = db.ExecuteQuery<int>(query);
            //    //var exhibit = (from e in db.EXHIBIT_DOC where e.DOC_NAME == ExhibitDetails select e).FirstOrDefault();
            //    //exhibit.EX_NO = ExhibitNumber;
            //    //db.SubmitChanges();
            //    ExhibitDetails = "";
            //    ExhibitNumber = "";
            //}
        }
コード例 #25
0
ファイル: TfcECNViewModel.cs プロジェクト: amuthagan/Invoic
        private void PrintCommand()
        {
            if (!TFCMODEL.PartNo.IsNotNullOrEmpty() || !TFCMODEL.ROUTENO.IsNotNullOrEmpty())
            {
                ShowInformationMessage(PDMsg.NotEmpty("Part No and Process No"));
                return;
            }

            else
            {
                DataTable dt;
                GridValues();
                dt = tfcecnbll.GetPrint(TFCMODEL);
                if (dt == null || dt.Rows.Count == 0)
                {
                    ShowInformationMessage(PDMsg.NoRecordsPrint);
                }
                else
                {
                    frmReportViewer frmrv = new frmReportViewer(dt, "TFC-ECN");
                    frmrv.ShowDialog();
                }
            }
        }
コード例 #26
0
        private void Delete()
        {
            try
            {
                if (PSWTitleMaster.PSWName.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Name"));
                    FocusButton = true;
                    return;
                }

                if (PSWTitleMaster.PSWTitle.Trim().Length <= 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Title"));
                    FocusButton = true;
                    return;
                }
                MessageBoxResult messageBoxResult = ShowWarningMessage(PDMsg.BeforeDelete("PSW Title"), MessageBoxButton.YesNo);
                //System.Windows.MessageBox.Show("Do you want to delete this PSW Title?", ApplicationTitle, System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    if (_pswTitleBll.DeletePswTitle(PSWTitleMaster.PSWName, PSWTitleMaster.PSWTitle))
                    {
                        ShowInformationMessage(PDMsg.DeletedSuccessfully);
                        FocusButton             = true;
                        PSWTitleMaster.PSWName  = string.Empty;
                        PSWTitleMaster.PSWTitle = string.Empty;
                        PSWTitleMaster.PSWTitleMasterDetails = _pswTitleBll.GetPswNameList();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #27
0
ファイル: Coatingmaster.cs プロジェクト: amuthagan/Invoic
        public bool AddNewCoatingMaster(bool isActive, string operCode, string operDesc, string showInCost, string nextAction, string colorapp, string salt_spray_white, string salt_spray_red, string cof, ref string message)
        {
            bool _status = false;

            if (nextAction == "ADD" && CheckCoatingEsxists(operCode) == true)
            {
                message = PDMsg.AlreadyExists("Coating Code");
                return(false);
            }

            DDCOATING_MAST ddCoattMaster = (from c in DB.DDCOATING_MAST
                                            where c.COATING_CODE == operCode
                                            //where (c.COATING_CODE == operCode || operDesc.ToUpper() == c.COATING_DESC.ToUpper())
                                            // && ((Convert.ToBoolean(Convert.ToInt16(c.DELETE_FLAG)) == false) || (c.DELETE_FLAG == null))
                                            //((Convert.ToBoolean(Convert.ToInt16(c.DELETE_FLAG)) == false) || c.DELETE_FLAG =null)
                                            select c).FirstOrDefault <DDCOATING_MAST>();

            try
            {
                if (nextAction == "DELETE")
                {
                    nextAction = "EDIT";
                }

                if (nextAction == "ADD")
                {
                    if (ddCoattMaster == null)
                    {
                        ddCoattMaster = new DDCOATING_MAST();
                        ddCoattMaster.COATING_CODE     = (string)operCode;
                        ddCoattMaster.COATING_DESC     = (string)operDesc;
                        ddCoattMaster.DELETE_FLAG      = isActive;
                        ddCoattMaster.COLORAPP         = colorapp;
                        ddCoattMaster.SALT_SPRAY_WHITE = salt_spray_white;
                        ddCoattMaster.SALT_SPRAY_RED   = salt_spray_red;
                        ddCoattMaster.COF          = cof;
                        ddCoattMaster.ENTERED_DATE = DateTime.Now;
                        ddCoattMaster.ENTERED_BY   = userInformation.UserName;
                        ddCoattMaster.ROWID        = Guid.NewGuid();
                        DB.DDCOATING_MAST.InsertOnSubmit(ddCoattMaster);
                        DB.SubmitChanges();
                        message = PDMsg.SavedSuccessfully;
                    }
                    //else
                    //{
                    //    if (CheckCoatingEsxists(operCode) == true)
                    //    {
                    //        message = PDMsg.AlreadyExists("Coating Code");
                    //        return false;
                    //    }
                    //    else
                    //    {
                    //        message = PDMsg.AlreadyExists("Coating Desc");
                    //        return false;
                    //    }
                    //    ////----- Check Delete Flag
                    //    //if (ddCoattMaster.DELETE_FLAG != true)
                    //    //{
                    //    //    ddCoattMaster.COATING_DESC = (string)operDesc;
                    //    //    ddCoattMaster.COLORAPP = colorapp;
                    //    //    ddCoattMaster.SALT_SPRAY_WHITE = salt_spray_white.ToIntValue();
                    //    //    ddCoattMaster.SALT_SPRAY_RED = salt_spray_red.ToIntValue();
                    //    //    ddCoattMaster.COF = cof.ToDecimalValue();
                    //    //    ddCoattMaster.UPDATED_DATE = DateTime.Now;
                    //    //    ddCoattMaster.DELETE_FLAG = isActive;
                    //    //    ddCoattMaster.UPDATED_BY = userInformation.UserName;
                    //    //    DB.SubmitChanges();
                    //    //    message = PDMsg.SavedSuccessfully;
                    //    //}
                    //    //else
                    //    //{

                    //    //    if (CheckCoatingEsxists(operCode) == true)
                    //    //    {
                    //    //        message = PDMsg.AlreadyExists("Coating Code");
                    //    //        return false;
                    //    //    }
                    //    //    else
                    //    //    {
                    //    //        message = PDMsg.AlreadyExists("Coating Desc");
                    //    //        return false;
                    //    //    }

                    //    //}
                    //}
                }
                else if (nextAction == "EDIT")
                {
                    if (CheckCoatingEsxistsDesc(operCode, operDesc) == true)
                    {
                        message = PDMsg.AlreadyExists("Coating Desc");
                        return(false);
                    }
                    ddCoattMaster.COATING_DESC     = (string)operDesc;
                    ddCoattMaster.COLORAPP         = colorapp;
                    ddCoattMaster.SALT_SPRAY_WHITE = salt_spray_white;
                    ddCoattMaster.SALT_SPRAY_RED   = salt_spray_red;
                    ddCoattMaster.COF          = cof;
                    ddCoattMaster.UPDATED_DATE = DateTime.Now;
                    ddCoattMaster.DELETE_FLAG  = isActive;
                    ddCoattMaster.UPDATED_BY   = userInformation.UserName;
                    DB.SubmitChanges();
                    message = PDMsg.UpdatedSuccessfully;
                }
                _status = true;
            }
            catch (Exception ex)
            {
                if (nextAction == "ADD")
                {
                    DB.DDCOATING_MAST.DeleteOnSubmit(ddCoattMaster);
                }
                else if (nextAction == "EDIT")
                {
                    DB.DDCOATING_MAST.Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, ddCoattMaster);
                }

                throw ex.LogException();
            }
            return(_status);
        }
コード例 #28
0
        private void Print()
        {
            if (!IsEnabledPrint)
            {
                return;
            }

            DataSet dsCFT = new DataSet();
            List <CFTMeetingModel> cftDt = new List <CFTMeetingModel>();

            if (CFTMeetingModel.PartNo.Trim().Length <= 0)
            {
                ShowInformationMessage(PDMsg.NotEmpty("PartNo"));
                return;
            }

            if (CFTMeetingModel.CFTMeetingIssueNo.Trim().Length <= 0)
            {
                ShowInformationMessage(PDMsg.NotEmpty("Issue Number"));
                return;
            }
            else if (CFTMeetingModel.CFTMeetingDate == null)
            {
                ShowInformationMessage(PDMsg.NotEmpty("CFT Meeting Date"));
                return;
            }
            //if (!CFTMeetingModel.PartNo.IsNotNullOrEmpty() && !CFTMeetingModel.CFTMeetingDate.IsNotNullOrEmpty())
            //{
            //    ShowInformationMessage(PDMsg.NoRecordsPrint);
            //    return;
            //}
            Progress.Start();
            if (CFTMeetingModel.PartNo.IsNotNullOrEmpty() && CFTMeetingModel.CFTMeetingDate.IsNotNullOrEmpty() && CFTMeetingModel.CFTMeetingIssueNo.IsNotNullOrEmpty())
            {
                try
                {
                    cftDt.Add(CFTMeetingModel);
                    DataTable dtTemp = new DataTable();

                    if (cftDt.ToDataTableWithType <CFTMeetingModel>().Rows.Count > 0)
                    {
                        dtTemp = cftDt.ToDataTableWithType <CFTMeetingModel>().Copy();
                        dtTemp.Columns.Add("Part_No");
                        for (int i = 0; i < dtTemp.Rows.Count; i++)
                        {
                            dtTemp.Rows[i]["Part_No"] = CFTMeetingModel.PartNo;
                        }
                        dsCFT.Tables.Add(dtTemp);
                        dtTemp.Columns.Remove("Part_No");
                    }

                    if (CFTMeetingModel.DtMidGrid.ToTable().Rows.Count > 0)
                    {
                        CFTMeetingModel.DtMidGrid.Table.Columns.Add("Part_No");
                        for (int i = 0; i < CFTMeetingModel.DtMidGrid.Table.Rows.Count; i++)
                        {
                            CFTMeetingModel.DtMidGrid.Table.Rows[i]["Part_No"] = CFTMeetingModel.PartNo;
                        }
                        dsCFT.Tables.Add(CFTMeetingModel.DtMidGrid.ToTable());
                        CFTMeetingModel.DtMidGrid.Table.Columns.Remove("Part_No");
                    }
                    if (CFTMeetingModel.DtSpecialCharacteristics.IsNotNullOrEmpty())
                    {
                        CFTMeetingModel.DtSpecialCharacteristics.Table.Columns.Add("Part_No");
                        for (int i = 0; i < CFTMeetingModel.DtSpecialCharacteristics.Table.Rows.Count; i++)
                        {
                            CFTMeetingModel.DtSpecialCharacteristics.Table.Rows[i]["Part_No"] = CFTMeetingModel.PartNo;
                        }
                        dsCFT.Tables.Add(CFTMeetingModel.DtSpecialCharacteristics.ToTable());
                        CFTMeetingModel.DtSpecialCharacteristics.Table.Columns.Remove("Part_No");
                    }
                    if (CFTMeetingModel.DtTimigChart.IsNotNullOrEmpty())
                    {
                        CFTMeetingModel.DtTimigChart.Table.Columns.Add("Part_No");
                        for (int i = 0; i < CFTMeetingModel.DtTimigChart.Table.Rows.Count; i++)
                        {
                            CFTMeetingModel.DtTimigChart.Table.Rows[i]["Part_No"] = CFTMeetingModel.PartNo;
                        }
                        dsCFT.Tables.Add(CFTMeetingModel.DtTimigChart.ToTable());
                        CFTMeetingModel.DtTimigChart.Table.Columns.Remove("Part_No");
                    }
                    if (_bll.ExihibitNoDetails().IsNotNullOrEmpty())
                    {
                        dsCFT.Tables.Add(_bll.ExihibitNoDetails());
                    }

                    //foreach (DataTable dt in dsCFT.Tables)
                    //{
                    //    dt.Rows.Clear();
                    //    dt.AcceptChanges();
                    //}
                    //dsCFT.WriteXmlSchema("E:\\" + dsCFT.DataSetName + ".xml");

                    frmReportViewer reportViewer     = new frmReportViewer(dsCFT, "CFTMeet");
                    ReportDocument  myReportDocument = new ReportDocument();
                    myReportDocument.PrintOptions.PaperSize = PaperSize.PaperA4;
                    Progress.End();
                    if (!reportViewer.ReadyToShowReport)
                    {
                        return;
                    }
                    reportViewer.ShowDialog();
                }
                catch (Exception ex)
                {
                    Progress.End();
                    ex.LogException();
                }
            }
            Progress.End();
            FocusButton = true;
        }
コード例 #29
0
        private void Refresh()
        {
            string startDate;
            string endDate;
            string message = "";
            Int64  cnt     = 0;

            try
            {
                if (StartDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Start Date"));
                    return;
                }

                if (EndDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("End Date"));
                    return;
                }

                if (StartDate > EndDate)
                {
                    ShowInformationMessage("Start Date is Greater than End Date,Please Check it.!");
                    return;
                }


                startDate = Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy");
                endDate   = Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy");

                if (_perfOption == performanceOption.CostSheetReceived)
                {
                    PerformanceResult = _ddPerformanceBll.CostSheetReceived(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForCostSheet();
                    message      = "Cost Sheets Received - ";
                    _reportTitle = "Cost Sheets Received Between " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.CostSheetCompleted)
                {
                    PerformanceResult = _ddPerformanceBll.CostSheetCompleted(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForCostSheet();
                    message      = "Cost Sheets Completed - ";
                    _reportTitle = "Cost Sheets Completed Between " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.PartNumberAllotted)
                {
                    PerformanceResult = _ddPerformanceBll.PartNumberAllotted(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForPartNoAllotted();
                    message      = "Part Numbers Allotted - ";
                    _reportTitle = "Part Numbers Allotted Between " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.DocumentReleased)
                {
                    PerformanceResult = _ddPerformanceBll.DocumentReleased(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForDocumentsReleased();
                    message      = "Documents Released - ";
                    _reportTitle = "Documents Released " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.SampleSubmitted)
                {
                    PerformanceResult = _ddPerformanceBll.SampleSubmitted(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForSamplesSubmitted();
                    message      = "Samples Submitted - ";
                    _reportTitle = "Samples Submitted " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                HeaderDetails = message + cnt.ToString() + (cnt > 0 ? " Entries" : " Entry") + " found ";
                NotifyPropertyChanged("HeaderDetails");
                NotifyPropertyChanged("PerformanceResult");
                NotifyPropertyChanged("HEADER1");
                NotifyPropertyChanged("VISIBLE");
                GC.Collect(2);
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
コード例 #30
0
ファイル: UnitMasterBll.cs プロジェクト: amuthagan/Invoic
        public bool AddNewUnitMaster(bool isActive, string operCode, string operDesc, string showInCost, string nextAction, ref string message)
        {
            bool _status = false;

            DDUNIT_MAST dduUnitMaster = (from c in DB.DDUNIT_MAST
                                         where (c.UNIT_CODE == operCode || operDesc.ToUpper() == c.UNIT_OF_MEAS.ToUpper())
                                         //                                         where c.UNIT_CODE == operCode
                                         //  && ((Convert.ToBoolean(Convert.ToInt16(c.DELETE_FLAG)) == false) || (c.DELETE_FLAG == null))
                                         select c).FirstOrDefault <DDUNIT_MAST>();

            try
            {
                if (nextAction == "DELETE")
                {
                    nextAction = "EDIT";
                }
                if (nextAction == "ADD")
                {
                    if (dduUnitMaster == null)
                    {
                        dduUnitMaster              = new DDUNIT_MAST();
                        dduUnitMaster.UNIT_CODE    = (string)operCode;
                        dduUnitMaster.UNIT_OF_MEAS = (string)operDesc;
                        dduUnitMaster.DELETE_FLAG  = isActive;
                        dduUnitMaster.ENTERED_DATE = DateTime.Now;
                        dduUnitMaster.ENTERED_BY   = userInformation.UserName;
                        dduUnitMaster.ROWID        = Guid.NewGuid();
                        DB.DDUNIT_MAST.InsertOnSubmit(dduUnitMaster);
                        DB.SubmitChanges();
                        message = PDMsg.SavedSuccessfully;
                    }
                    else
                    {
                        if (CheckUnitEsxists(operCode) == true)
                        {
                            message = PDMsg.AlreadyExists("Unit Code");
                            return(false);
                        }
                        else
                        {
                            message = PDMsg.AlreadyExists("Unit Desc");
                            return(false);
                        }
                        //if (dduUnitMaster.DELETE_FLAG != true)
                        //{
                        //    dduUnitMaster.UNIT_OF_MEAS = (string)operDesc;
                        //    dduUnitMaster.UPDATED_DATE = DateTime.Now;
                        //    dduUnitMaster.DELETE_FLAG = isActive;
                        //    dduUnitMaster.UPDATED_BY = userInformation.UserName;
                        //    DB.SubmitChanges();
                        //    message = PDMsg.SavedSuccessfully;
                        //}
                        //else
                        //{
                        //    if (CheckUnitEsxists(operCode) == true)
                        //    {
                        //        message = PDMsg.AlreadyExists("Unit Code");
                        //        return false;
                        //    }
                        //    else
                        //    {
                        //        message = PDMsg.AlreadyExists("Unit Desc");
                        //        return false;
                        //    }

                        //}

                        // message = "Finish Code already Exists";
                        // return false;
                    }
                }
                else if (nextAction == "EDIT")
                {
                    if (CheckUnitEsxistsDesc(operCode, operDesc) == true)
                    {
                        message = PDMsg.AlreadyExists("Unit Desc");
                        return(false);
                    }
                    dduUnitMaster.UNIT_OF_MEAS = (string)operDesc;
                    dduUnitMaster.UPDATED_DATE = DateTime.Now;
                    dduUnitMaster.DELETE_FLAG  = isActive;
                    dduUnitMaster.UPDATED_BY   = userInformation.UserName;
                    DB.SubmitChanges();
                    message = PDMsg.UpdatedSuccessfully;
                }
                _status = true;
            }
            catch (Exception ex)
            {
                ex.LogException();
                if (nextAction == "ADD")
                {
                    DB.DDUNIT_MAST.DeleteOnSubmit(dduUnitMaster);
                }
                else if (nextAction == "EDIT")
                {
                    DB.DDUNIT_MAST.Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, dduUnitMaster);
                }
            }
            return(_status);
        }