コード例 #1
0
ファイル: DownloadITR.xaml.cs プロジェクト: paraneye/WinApp
        private void btnDownload_Click(object sender, RoutedEventArgs e)
        {
            _SelectITRs = new List<FiwpqaqcDTO>();

            if (gvITRList.SelectedItems.Count < 1)
            {
                WinAppLibrary.Utilities.Helper.SimpleMessage("Please Select Download ITR", "Caution!");
            }
            else
            {
                try
                {
                    List<QaqcformtemplateDTO> QaqcList = new List<QaqcformtemplateDTO>();
                    var dtos = gvITRList.SelectedItems.ToList();
                    
                   //select ITR Download
                    foreach (FiwpqaqcDTO item in dtos)
                    {
                        QaqcformtemplateDTO selectQaqc = new QaqcformtemplateDTO();
                        selectQaqc.QAQCFormTemplateID = Convert.ToInt32(item.QAQCFormTemplateID);
                        selectQaqc.QAQCTypeLUID = Convert.ToInt32(item.QAQCTypeLUID);
                        selectQaqc.QAQCFormCode = item.QAQCFormCode;
                        QaqcList.Add(selectQaqc);
                        _SelectITRs.Add(item);
                    }

                    DownloadITRList(QaqcList);
                    
                }
                catch (Exception ex)
                {
                    WinAppLibrary.Utilities.Helper.SimpleMessage("Download Failed", "Caution!");                    
                }
            }

        }
コード例 #2
0
ファイル: DownloadITR.xaml.cs プロジェクト: paraneye/WinApp
        private async Task<bool> SaveITRList()
        {
            bool retvalue = true;

            if (_QaqcForm.Count < 1)
                WinAppLibrary.Utilities.Helper.SimpleMessage("Downloaded ITR Count 0. Please Check Data.", "Error!");
            else
            {
                List<QaqcformtemplateDTO> saveQaqcformtemplateDTO = new List<QaqcformtemplateDTO>();
                try
                {                    
                    //Save QaqcForm + Download List
                    foreach (QaqcformDTO item in _QaqcForm)
                    {
                        //파일명 = QAQCFormID_QAQCFormTemplateID.xml
                        _savedFileName = item.QAQCFormID.ToString() + "_" + item.QAQCFormTemplateID.ToString() + ".xml";

                        bool blSaved = false;
                        blSaved = await SaveToQaqcForm(item, BaseFolder, _savedFileName);

                        if (blSaved)
                        {
                        //Download List에 저장될 내용 추가
                        //파일명(키값) = QaqcformtemplateDTO.QAQCFormTemplateID_QaqcformtemplateDTO.QAQCTypeLUID
                        //QaqcformtemplateDTO.Rev = FiwpName
                        //QaqcformtemplateDTO.QAQCFormTemplateID = QAQCFormID
                        //QaqcformtemplateDTO.QAQCTypeLUID = QAQCFormTemplateID
                        //QaqcformtemplateDTO.Description = Download Date
                        //QaqcformtemplateDTO.QAQCFormCode = Status(1:Download, 2:Saved, 3:Ready to Submit)
                        //QaqcformtemplateDTO.QAQCFormTemplateName = QAQCFormTemplateName
                            QaqcformtemplateDTO list = new QaqcformtemplateDTO();
                            
                            list.QAQCFormTemplateID = item.QAQCFormID;
                            list.QAQCTypeLUID = item.QAQCFormTemplateID;
                            list.QAQCFormRev = txtFiwpName.Text;
                            list.Description = DateTime.Now.ToString();
                            list.QAQCFormCode = "1";  //"3" - Ready to Submit

                            foreach (FiwpqaqcDTO ditem in _SelectITRs)
                            {
                                if (item.QAQCFormTemplateID == ditem.QAQCFormTemplateID)
                                {
                                    list.QAQCFormTemplateName = ditem.QAQCFormTemplateName;
                                }
                            }

                            saveQaqcformtemplateDTO.Add(list);
                        }
                        else
                        {
                            retvalue = false;
                            WinAppLibrary.Utilities.Helper.SimpleMessage("Save to LocalStorage Error!", "Error");
                        }

                    }

                    _QaqcFormTemplate = saveQaqcformtemplateDTO;

                    await SaveFileList();
                }
                catch (Exception ex)
                {
                    retvalue = false;
                    WinAppLibrary.Utilities.Helper.SimpleMessage("SaveITRList Error", "Error!");
                }
            }
            return retvalue;
        }
コード例 #3
0
        /// <summary>
        /// bind list from service for Quality Management
        /// </summary>
        private async void bindListfromService()
        {
            List<QaqcformtemplateDTO> dto = new List<QaqcformtemplateDTO>();

            Lib.ServiceModel.ProjectModel project = new Lib.ServiceModel.ProjectModel();
            try
            {
                _oservices = await project.GetQaqcformByQcManager(_projectid, _moduleid, Convert.ToInt16(_loginid));
                if (_oservices.Count < 0)
                {
                    WinAppLibrary.Utilities.Helper.SimpleMessage("Not Found Data", "Not Found Data!");
                    return;
                }

                List<FiwpqaqcDTO> itrs = await project.GetITRListByFiwp(Login.UserAccount.FIWPID);
                foreach (QaqcformDTO item in _oservices)
                {
                    QaqcformtemplateDTO data = new QaqcformtemplateDTO();

                    data.QAQCFormTemplateID = item.QAQCFormID;
                    data.QAQCTypeLUID = item.QAQCFormTemplateID;
                    data.QAQCFormRev = item.FIWPName;
                    data.Description = DateTime.Now.ToString();
                    data.QAQCFormCode = "Ready to Approval";  // 4 : Ready to Approval"

                    foreach (FiwpqaqcDTO ditem in itrs)
                    {
                        if (item.QAQCFormTemplateID == ditem.QAQCFormTemplateID)
                        {
                            data.QAQCFormTemplateName = ditem.QAQCFormTemplateName;
                            break;
                        }
                    }

                    dto.Add(data);
                }

                // Bind
                gvDocument.ItemsSource = dto.OrderBy(x => x.QAQCFormTemplateName).ThenBy(y => y.Description).ThenBy(z => z.QAQCFormCode);
            }
            catch
            {
                WinAppLibrary.Utilities.Helper.SimpleMessage("Bind Error", "Error!");
            }

        }