Пример #1
0
 public bool GetPSW(PartSubmissionWarrantModel psw)
 {
     try
     {
         var ps = (from p in DB.PRD_MAST
                   join r in DB.PRD_CIREF on p.PART_NO equals r.PART_NO
                   join i in DB.DDCI_INFO on r.CI_REF equals i.CI_REFERENCE
                   join c in DB.DDCUST_MAST on i.CUST_CODE equals c.CUST_CODE
                   join l in DB.DDLOC_MAST on p.BIF_PROJ equals l.LOC_CODE
                   where p.PART_NO == psw.PART_NO && r.CURRENT_CIREF == true
                   select new
         {
             c.CUST_NAME,
             i.CUST_DWG_NO,
             i.CUST_DWG_NO_ISSUE,
             i.CUST_CODE,
             i.CUST_STD_DATE,
             p.PART_DESC,
             p.FINISH_WT,
             i.CUST_STD_NO,
             l.PhoneNo,
             l.FaxNo,
             l.Address,
             l.LOC
         }).FirstOrDefault();
         if (ps != null)
         {
             psw.CUSTOMERNAME      = ps.CUST_NAME;
             psw.CUST_DWG_NO       = ps.CUST_DWG_NO;
             psw.CUST_DWG_NO_ISSUE = ps.CUST_DWG_NO_ISSUE;
             psw.SHOWNDRAWINGNO    = ps.CUST_STD_NO;
             psw.CUST_STD_DATE     = ps.CUST_STD_DATE;
             psw.PART_DESC         = ps.PART_DESC;
             psw.PHONENO           = ps.PhoneNo;
             psw.FAXNO             = ps.FaxNo;
             psw.ADDRESS           = ps.Address;
             psw.LOC = ps.LOC;
         }
         EXHIBIT_DOC exhibit = (from o in DB.EXHIBIT_DOC
                                where o.DOC_NAME == "PSW"
                                select o).FirstOrDefault <EXHIBIT_DOC>();
         if (exhibit != null)
         {
             psw.EX_NO       = exhibit.EX_NO;
             psw.REVISION_NO = exhibit.REVISION_NO;
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex.LogException();
     }
 }
Пример #2
0
        public DataTable GetQCP(PCCSModel pccs, QcpModel qcp)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = ToDataTable((from r in DB.PRD_CIREF
                                  join p in DB.PRD_MAST on r.PART_NO equals p.PART_NO
                                  into a from b in a.DefaultIfEmpty()
                                  join i in DB.DDCI_INFO on r.CI_REF equals i.CI_REFERENCE
                                  join c in DB.DDCUST_MAST on i.CUST_CODE equals c.CUST_CODE
                                  join e in DB.PROCESS_MAIN on r.PART_NO equals e.PART_NO
                                  join d in DB.CONTROL_PLAN on e.ROUTE_NO equals d.ROUTE_NO
                                  into y from z in y.DefaultIfEmpty()
                                  where z.PART_NO == e.PART_NO && e.CURRENT_PROC == 1 && r.PART_NO == qcp.PartNo.ToUpper() && r.CURRENT_CIREF == true
                                  select new
                {
                    c.CUST_NAME,
                    i.ENQU_RECD_ON,
                    b.PART_DESC,
                    b.BIF_PROJ,
                    r.PART_NO,
                    e.ROUTE_NO,
                    z.CORE_TEAM_MEMBER1,
                    z.CORE_TEAM_MEMBER2,
                    z.CORE_TEAM_MEMBER3,
                    z.CORE_TEAM_MEMBER4,
                    z.CORE_TEAM_MEMBER5,
                    z.CORE_TEAM_MEMBER6,
                    EX_NO = "",
                    REVISION_NO = ""
                }).ToList());

                if (dt != null && dt.Rows.Count > 0)
                {
                    EXHIBIT_DOC exhibit = (from o in DB.EXHIBIT_DOC
                                           where o.DOC_NAME == "PQPSO"
                                           select o).FirstOrDefault <EXHIBIT_DOC>();
                    if (exhibit != null)
                    {
                        dt.Rows[0]["EX_NO"]       = exhibit.EX_NO;
                        dt.Rows[0]["REVISION_NO"] = exhibit.REVISION_NO;
                    }
                }
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
Пример #3
0
        public bool updateExhitbitMaster(string exhibitNumber, string exhibitDetails)
        {
            EXHIBIT_DOC exhibit = (from e in DB.EXHIBIT_DOC
                                   where e.DOC_NAME == exhibitDetails &&
                                   ((Convert.ToBoolean(Convert.ToInt16(e.DELETE_FLAG)) == false) || (e.DELETE_FLAG == null))
                                   select e).FirstOrDefault <EXHIBIT_DOC>();

            try
            {
                if (exhibit != null)
                {
                    exhibit.EX_NO        = exhibitNumber;
                    exhibit.UPDATED_DATE = DateTime.Now;
                    exhibit.UPDATED_BY   = userInformation.UserName;
                    exhibit.DELETE_FLAG  = false;
                    //exhibit.DOC_NAME = exhibitDetails;
                    DB.SubmitChanges();
                }


                exhibit = null;

                //string query = "UPDATE EXHIBIT_DOC set EX_NO='" + exhibitNumber + "' , UPDATED_DATE = GETDATE() , UPDATED_BY ='" + userInformation.UserName + "' WHERE DOC_NAME='" + exhibitDetails + "'";
                //IEnumerable<int> result = DB.ExecuteQuery<int>(query);
                //DB.SubmitChanges();
                return(true);
            }
            catch (System.Data.Linq.ChangeConflictException)
            {
                DB.ChangeConflicts.ResolveAll(System.Data.Linq.RefreshMode.KeepChanges);
                return(false);
            }
            catch (Exception ex)
            {
                ex.LogException();
                DB.EXHIBIT_DOC.Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, exhibit);
            }
            return(false);
        }
Пример #4
0
        private void PrintECNOrPCN()
        {
            try
            {
                string smessage = "";
                drwBll.IsDefaultSubmitRequired = false;
                if (PartNo.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Part No."));
                    return;
                }
                //  CheckBox chkdraw = (CheckBox)_mdiChild.FindName("chkprddrawing");
                //      if (_screenType=="PCN")
                //       {
                //chkdraw.Visibility = System.Windows.Visibility.Hidden;
                //       }
                smessage = (_screenType == "ECN" ? "ECN" : "PCN");
                if (PCNSheetNo.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty(smessage + " Number"));
                    return;
                }
                //if (DDPCNECNModel.SFL_DRAW_ISSUENO.ToValueAsString().Trim() == "")
                if (SFLDrawIssueNo.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Pro.Seq.Drg.Issue No."));
                    return;
                }

                if (SFLDrawIssueNo1.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Pro.Drg.Issue No."));
                    return;
                }
                if (ShowWarningMessage(PDMsg.BeforeCloseForm, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    isPrintClicked = true;
                    SaveECNOrPCN();
                }
                else
                {
                    if (AddEnable)
                    {
                        DDPCNECNModel.SNO = (SelectedRow != null) ? SelectedRow["SNO"].ToString().ToIntValue() : 0;
                        //System.Resources.ResourceManager myManager;
                        //myManager = new System.Resources.ResourceManager(typeof(ProcessDesigner.Properties.Resources));
                        //string conStr = myManager.GetString("ConnectionString");

                        //DataAccessLayer dal = new DataAccessLayer(conStr);
                        //DDPCNECNModel.SNO = dal.Get_Ecn_Pcn_Sel_Sno(DDPCNECNModel.PART_NO, _screenType);
                        GetECNMPSDetails();
                    }
                }
                DDPCNECNModel.SFL_DRAW_ISSUENO  = Convert.ToDecimal(SFLDrawIssueNo);
                DDPCNECNModel.SFL_DRAW_ISSUENO1 = Convert.ToDecimal(SFLDrawIssueNo1);
                DDPCNECNModel.PRODUCT_CHANGE_NO = PCNSheetNo;


                DataTable     dtData     = new DataTable();
                List <DD_PCN> lstDDPCN   = new List <DD_PCN>();
                EXHIBIT_DOC   entity     = new EXHIBIT_DOC();
                string        docName    = "ECN";
                string        formatNo   = "";
                string        revisionNo = "";
                lstDDPCN.Add(DDPCNECNModel);
                dtData = Essential.ToDataTable(lstDDPCN);

                if (dtData.Rows.Count > 0)
                {
                    foreach (DataColumn dc in dtData.Columns)
                    {
                        if (dtData.Rows[0][dc].ToValueAsString().Trim() == "")
                        {
                            dtData.Rows[0][dc] = "";
                        }
                    }
                    dtData.Rows[0]["SFL_DRAW_ISSUE_DATE"]    = ReplaceString(dtData.Rows[0]["SFL_DRAW_ISSUE_DATE"].ToValueAsString());
                    dtData.Rows[0]["SFL_DRAW_ISSUEDATE1"]    = ReplaceString(dtData.Rows[0]["SFL_DRAW_ISSUEDATE1"].ToValueAsString());
                    dtData.Rows[0]["DATE_OF_IMPLEMENTATION"] = ReplaceString(dtData.Rows[0]["DATE_OF_IMPLEMENTATION"].ToValueAsString());
                    dtData.Rows[0]["DATE_OF_PCN"]            = ReplaceString(dtData.Rows[0]["DATE_OF_PCN"].ToValueAsString());
                    dtData.Rows[0]["INVOICE_DATE"]           = ReplaceString(dtData.Rows[0]["INVOICE_DATE"].ToValueAsString());
                    dtData.Rows[0]["SIGNATURE_DATE"]         = ReplaceString(dtData.Rows[0]["SIGNATURE_DATE"].ToValueAsString());
                    if (!AddEnable)
                    {
                        dtData.Rows[0]["RE_PPAP"] = RE_PPAP;
                    }
                }

                docName = (_screenType == "ECN" ? "ECN" : "PCN");
                try
                {
                    entity = (from row in drwBll.DB.EXHIBIT_DOC
                              where row.DOC_NAME == docName && (row.DELETE_FLAG == false || row.DELETE_FLAG == null)
                              select row).FirstOrDefault();
                    if (entity != null)
                    {
                        formatNo   = entity.EX_NO.ToValueAsString().Trim();
                        revisionNo = entity.REVISION_NO.ToValueAsString().Trim();
                        //revisionNo = entity.
                    }
                }
                catch (Exception ex1)
                {
                }
                frmReportViewer report = new frmReportViewer(dtData, "ECNPCN", _screenType, formatNo, revisionNo);
                report.ShowDialog();
                if (isPrintClicked)
                {
                    //AddECNOrPCN();
                    isPrintClicked = false;
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
Пример #5
0
        public DataTable print(TfcModel tfcmodel)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = ToDataTable((from p in DB.PROCESS_MAIN
                                  from c in DB.CONTROL_PLAN.Where(mapping => mapping.PART_NO == p.PART_NO && mapping.ROUTE_NO == p.ROUTE_NO).DefaultIfEmpty()
                                  where p.ROUTE_NO == tfcmodel.ROUTENO.ToDecimalValue() && p.PART_NO == tfcmodel.PartNo
                                  select new
                {
                    p.PART_NO,
                    p.ROUTE_NO,
                    c.CORE_TEAM_MEMBER1,
                    c.CORE_TEAM_MEMBER2,
                    c.CORE_TEAM_MEMBER3,
                    c.CORE_TEAM_MEMBER4,
                    c.CORE_TEAM_MEMBER5,
                    c.CORE_TEAM_MEMBER6,
                    c.CORE_TEAM_MEMBER7,
                    EX_NO = "",
                    REVISION_NO = "",
                    CUST_NAME = "",
                    CUST_PARTNO = "",
                    DATE = "",
                    PART_NAME = "",
                    APPLIC_ATION = "",
                    AUTOPART_YES = "",
                    AUTOPART_NO = "",
                    PROTOTYPE = "",
                    PRELAUNCH = "",
                    PRODUCTION = "",
                    FEASIBLE_CHANGE = "",
                    FEASIBLE_PRODUCT = "",
                    NOT_FEASIBLE = "",
                    Q1 = "",
                    Q2 = "",
                    Q3 = "",
                    Q4 = "",
                    Q5 = "",
                    Q6 = "",
                    Q7 = "",
                    Q8 = "",
                    Q9 = "",
                    Q10 = "",
                    Q11 = "",
                    Q12 = "",
                    Q13 = "",
                    IMPACT1 = "",
                    IMPACT2 = "",
                    IMPACT3 = "",
                    IMPACT4 = "",
                    IMPACT5 = "",
                    IMPACT6 = "",
                    IMPACT7 = "",
                    REASON1 = "",
                    REASON2 = "",
                    REASON3 = "",
                    REASON4 = "",
                    REASON5 = "",
                    REASON6 = "",
                    REASON7 = ""
                }).ToList());
                if (dt != null && dt.Rows.Count > 0)
                {
                    EXHIBIT_DOC exhibit = (from o in DB.EXHIBIT_DOC
                                           where o.DOC_NAME == "TFC"
                                           select o).FirstOrDefault <EXHIBIT_DOC>();
                    if (exhibit != null)
                    {
                        dt.Rows[0]["EX_NO"]       = exhibit.EX_NO;
                        dt.Rows[0]["REVISION_NO"] = exhibit.REVISION_NO;
                    }
                }

                if (dt != null && dt.Rows.Count > 0)
                {
                    dt.Rows[0]["CUST_NAME"]        = tfcmodel.CUSTOMERNAME;
                    dt.Rows[0]["CUST_PARTNO"]      = tfcmodel.CUSTOMERPARTNO;
                    dt.Rows[0]["DATE"]             = tfcmodel.DATE;
                    dt.Rows[0]["PART_NAME"]        = tfcmodel.PartDesc;
                    dt.Rows[0]["APPLIC_ATION"]     = tfcmodel.APPLICATION;
                    dt.Rows[0]["AUTOPART_YES"]     = tfcmodel.AUTOPARTYES;
                    dt.Rows[0]["AUTOPART_NO"]      = tfcmodel.AUTOPARTNO;
                    dt.Rows[0]["PROTOTYPE"]        = tfcmodel.PROTOTYPE;
                    dt.Rows[0]["PRELAUNCH"]        = tfcmodel.PRELAUNCH;
                    dt.Rows[0]["PRODUCTION"]       = tfcmodel.PRODUCTION;
                    dt.Rows[0]["FEASIBLE_CHANGE"]  = tfcmodel.FEASIBLECHANGE;
                    dt.Rows[0]["FEASIBLE_PRODUCT"] = tfcmodel.FEASIBLEPRODUCT;
                    dt.Rows[0]["NOT_FEASIBLE"]     = tfcmodel.NOTFEASIBLE;
                    dt.Rows[0]["Q1"]      = tfcmodel.Q1;
                    dt.Rows[0]["Q2"]      = tfcmodel.Q2;
                    dt.Rows[0]["Q3"]      = tfcmodel.Q3;
                    dt.Rows[0]["Q4"]      = tfcmodel.Q4;
                    dt.Rows[0]["Q5"]      = tfcmodel.Q5;
                    dt.Rows[0]["Q6"]      = tfcmodel.Q6;
                    dt.Rows[0]["Q7"]      = tfcmodel.Q7;
                    dt.Rows[0]["Q8"]      = tfcmodel.Q8;
                    dt.Rows[0]["Q9"]      = tfcmodel.Q9;
                    dt.Rows[0]["Q10"]     = tfcmodel.Q10;
                    dt.Rows[0]["Q11"]     = tfcmodel.Q11;
                    dt.Rows[0]["Q12"]     = tfcmodel.Q12;
                    dt.Rows[0]["Q13"]     = tfcmodel.Q13;
                    dt.Rows[0]["IMPACT1"] = tfcmodel.IMPACT1;
                    dt.Rows[0]["IMPACT2"] = tfcmodel.IMPACT2;
                    dt.Rows[0]["IMPACT3"] = tfcmodel.IMPACT3;
                    dt.Rows[0]["IMPACT4"] = tfcmodel.IMPACT4;
                    dt.Rows[0]["IMPACT5"] = tfcmodel.IMPACT5;
                    dt.Rows[0]["IMPACT6"] = tfcmodel.IMPACT6;
                    dt.Rows[0]["IMPACT7"] = tfcmodel.IMPACT7;
                    dt.Rows[0]["REASON1"] = tfcmodel.REMARKS1;
                    dt.Rows[0]["REASON2"] = tfcmodel.REMARKS2;
                    dt.Rows[0]["REASON3"] = tfcmodel.REMARKS3;
                    dt.Rows[0]["REASON4"] = tfcmodel.REMARKS4;
                    dt.Rows[0]["REASON5"] = tfcmodel.REMARKS5;
                    dt.Rows[0]["REASON6"] = tfcmodel.REMARKS6;
                    dt.Rows[0]["REASON7"] = tfcmodel.REMARKS7;
                }
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }