private void SendEmail() { string context = "HANOI_TBHUY"; //int ReportID = 18; //Luu thong tin //UpdateInfo(); if (UpdateTransaction()) { string inputValue = "<RequestParams Context=\"{0}\" RegisTransRefNo=\"{1}\" ViewID=\"35\" ViewerID=\"25\" RefNo=\"{2}\" ObjectID=\"{3}\" Email=\"{4}\" IncludeSign=\"1\"/>"; inputValue = string.Format(inputValue, context, CXML.HtmlEnCode(this.CurrentTransaction.RegisTransRefNo), CXML.HtmlEnCode(this.RefNo), this.ObjectID, txtEmail.Text); inputValue = CXML.AddAuthenticate(inputValue); string result = CServiceReference.AssetService.SendReport(CSession.CLIENT_KEY, inputValue); //FWS.TTDKGDTS.ImportTool.ServiceReference.Soap.CApplicationMessage message = CServiceReference.AssetService.UpdateAndSendReport(CSession.CLIENT_KEY, inputValue); BusinessObject.CApplicationMessage message = CObjectMapper.FromCSV <BusinessObject.CApplicationMessage>(result)[0]; if (message.IsSuccessfull) { ShowInfo(message.Description); } else { ShowError(message.Description); } } else { ShowError(Message); } }
private void SendEmail() { string context = ""; int ReportID = 18; //Luu thong tin UpdateSoDonNhan(); string inputValue = "<RequestParams RefType=\"{6}\" Context=\"{3}\" RefNo=\"{0}\" ViewID=\"38\" ViewerID=\"{5}\" ID=\"{4}\" IncludeSign=\"1\" Email=\"{7}\" SoNhanDon=\"{8}\" FileNumber=\"{9}\"/>"; inputValue = string.Format(inputValue, CXML.HtmlEnCode(this.CurrentTransaction.RefNo), CSession.UserID, CSession.CLIENT_KEY, context, this.CurrentTransaction.ID, ReportID, this.CurrentTransaction.RefType, EmailKH, txtNumber.Text, this.CurrentTransaction.FileNumber); inputValue = CXML.AddAuthenticate(inputValue); string result = CServiceReference.AssetService.SendGCN(CSession.CLIENT_KEY, inputValue); //FWS.TTDKGDTS.ImportTool.ServiceReference.Soap.CApplicationMessage message = CServiceReference.AssetService.UpdateAndSendReport(CSession.CLIENT_KEY, inputValue); BusinessObject.CApplicationMessage message = CObjectMapper.FromCSV <BusinessObject.CApplicationMessage>(result)[0]; if (message.IsSuccessfull) { ShowInfo(message.Description); } else { ShowError(message.Description); } }
private void GetInfoByOriginalRefNo_1(string OrgRefNo) { if (string.IsNullOrEmpty(OrgRefNo)) { return; } CCoreService service = new CCoreService(); string inputValue = string.Format("<InputValue UserID=\"{1}\" /><RequestParams Function='GetTransaction_Asset' RefType='22' RegisTransRefNo='{0}'/>", OrgRefNo, CSession.UserID); inputValue = inputValue + string.Format("<RequestParams Function=\"GetTransaction_Asset\" RefType=\"21\" RefNo=\"{0}\" Context=\"AssetsList\"/>", OrgRefNo); inputValue = inputValue + string.Format("<RequestParams Function=\"GetTransaction_Asset\" RefType=\"21\" RefNo=\"{0}\" Context=\"AssetOwnerList\"/>", OrgRefNo); string datacsv = service.GetContextData(CSession.CLIENT_KEY, CXML.HtmlEnCode(inputValue)); IList <CTransaction> trans = CObjectMapper.FromCSV <CTransaction>(datacsv, 1); List <Asset> asset = CObjectMapper.FromCSV <Asset>(datacsv, 2); List <Person> ownner = CObjectMapper.FromCSV <Person>(datacsv, 3); if (trans != null && trans.Count > 0) { if (CurrentTransaction.Assets == null || CurrentTransaction.Assets.Count == 0) { CurrentTransaction.Assets = asset; } if (CurrentTransaction.AssetOwnerID == 0 && !string.IsNullOrEmpty(CurrentTransaction.AssetOwnerName)) { CurrentTransaction.AssetOwnerID = trans[0].AssetOwnerID; } if (string.IsNullOrEmpty(CurrentTransaction.AssetOwnerName)) { CurrentTransaction.AssetOwnerName = trans[0].AssetOwnerName; } if (string.IsNullOrEmpty(CurrentTransaction.AssetPersonalCode)) { CurrentTransaction.AssetPersonalCode = trans[0].AssetPersonalCode; } if (CurrentTransaction.AssetOwnnerList == null || CurrentTransaction.AssetOwnnerList.Count == 0) { CurrentTransaction.AssetOwnnerList = ownner; } BindingSource source = new BindingSource(); source.DataSource = CurrentTransaction.AssetOwnnerList; grAssetOwnner.DataSource = source; } }
private CApplicationMessage UpdateSoDonNhan() { string inputValue = "<RequestParams RefType=\"21\" Context=\"TOOL\" Function=\"Transaction_Asset\" Action=\"UpdateGCNEmail\" RefNo=\"{0}\" ID=\"{1}\" SoDonNhan=\"{2}\" SendGCNEmail=\"{3}\"/>"; inputValue = string.Format(inputValue, CXML.HtmlEnCode(this.CurrentTransaction.RefNo), this.CurrentTransaction.ID, txtNumber.Text, txtEmail.Text); inputValue = CXML.AddAuthenticate(inputValue); string result = CServiceReference.CoreService.ExecuteAction(CSession.CLIENT_KEY, inputValue); List <CApplicationMessage> mess = CObjectMapper.FromCSV <CApplicationMessage>(result); if (mess != null && mess.Count > 0) { return(mess[0]); } return(null); }
public bool UpdateTransaction() { UpdateSoDonNhan(); CurrentTransaction.ReceiveDateTime = GetReceiveDateTime();// txtReceiveDateTime.Value; CurrentTransaction.NumPagesAttachment = (int)txtNumPagesAttachment.Value; //CurrentTransaction.AssetIDCardNo = txtIDNo.Text; CurrentTransaction.AssetPersonalCode = txtPersonalCode.Text; string requestparams = CurrentTransaction.GetRequestParams("Function='Transaction_Asset' Action='UPDATEGCN'"); CCoreService service = new CCoreService(); requestparams = CXML.AddAuthenticate(requestparams); string messageCSV = service.ExecuteAction(CSession.CLIENT_KEY, CXML.HtmlEnCode(requestparams)); IList <FWS.TTDKGDTS.ImportTool.BusinessObject.CApplicationMessage> message = CObjectMapper.FromCSV <FWS.TTDKGDTS.ImportTool.BusinessObject.CApplicationMessage>(messageCSV, 1); if (message[0].Result == null || message[0].Result.ToString() == "" || message[0].Result.ToString() == "0") { MessageBox.Show(message[0].Description); return(false); } return(true); }
private void InitComboboxData() { CCoreService service = new CCoreService(); string inputValue = "<InputValue UserID=\"14\" />"; inputValue += "<RequestParams Function='GetPerson' FilterCode='BANK'/>"; //inputValue += "<RequestParams Function='FilterParaData' ListFunction='VoucherActionType'/>"; string datacsv = service.GetContextData(CSession.CLIENT_KEY, CXML.HtmlEnCode(inputValue)); //directionDataSource = CObjectMapper.FromCSV<CParaData>(datacsv, 2); //txtDirection.DisplayMember = "Name"; //txtDirection.ValueMember = "ID"; //txtDirection.DataSource = directionDataSource; //IList<CParaData> actionlist = CObjectMapper.FromCSV<CParaData>(datacsv, 3); //txtVoucherActionType.DisplayMember = "Name"; // txtVoucherActionType.ValueMember = "Value"; //txtVoucherActionType.DataSource = actionlist; directionDataSource = CObjectMapper.FromCSV <CPerson>(datacsv, 1); //txtDirection.DisplayMember = "Name"; //txtDirection.ValueMember = "ID"; //txtDirection.DataSource = directionDataSource; txtKHTX.Items.Clear(); foreach (CPerson d in directionDataSource) { txtKHTX.Items.Add(new Core.AutoComplete.AutoCompleteEntry(d.Name, d.Code, d.Name, d.Address) { Value = d.ID, DisplayMemberSub = d.Code + " - " + d.Address, Tag = d }); } }
public bool UpdateTransaction() { // == Kiem tra RefNo truoc neu refno moi if (isNew) { string inputValue = string.Format("<InputValue RefType='28' RefDate='{0}'/>", DateTime.Now.ToString("yyyy-MM-dd")); CRefNo objRefNo = CServiceReference.CoreService.GetNextRefNo(inputValue); int compareResult = string.Compare(objRefNo.RefNo, txtRefNo.Text, true); if (compareResult > 0) { DialogResult dr = ShowQuestion("Số công văn đã thay đổi, số mới là:" + objRefNo.RefNo + ". Bạn có muốn in với số mới không?"); if (dr == DialogResult.Yes) { txtRefNo.Text = objRefNo.RefNo; } else { return(false); } } } // CurrentTransaction.OldRefNo = txtOldRefNo.Text; //CurrentTransaction.AssetType = int.Parse(txtAssetType.SelectedValue.ToString()); CurrentTransaction.RefDate = GetRefDateTime(); //CurrentTransaction.RefNo = txtRefNo.Text;// CurrentTransaction.RegisTransRefNo; //CurrentTransaction.RefType = 21; //CurrentTransaction.Type = int.Parse(txtVoucherActionType.SelectedValue.ToString()); //CurrentTransaction.ObjectID = int.Parse(txtDirection.SelectedValue.ToString()); CurrentTransaction.Note = txtReason.Text; CurrentTransaction.SendGCNEmail = txtEmail.Text; if (txtKHTX.SelectedItem != null) { CurrentTransaction.WarranterID = (int)txtKHTX.SelectedItem.Value; CurrentTransaction.WarranterName = txtKHTX.Text; CurrentTransaction.WarranterAddress = txtAddress.Text; //CurrentTransaction.ObjectEmail = txtObjectEmail.Text; } else { CurrentTransaction.WarranterID = 0; CurrentTransaction.WarranterName = txtKHTX.Text; CurrentTransaction.WarranterAddress = txtAddress.Text; //CurrentTransaction.ObjectEmail = txtObjectEmail.Text; } //CurrentTransaction.IsSendMail = chkSendMail.Checked; //CurrentTransaction.IsSendMailKH = chkSendEmailKH.Checked; //CurrentTransaction.WarranterEmail = txtWarranterEmail.Text; string requestparams = CurrentTransaction.GetRequestParams("Function='Transaction_Asset' Action='UPDATE' Context='TOOL'"); CCoreService service = new CCoreService(); requestparams = CXML.AddAuthenticate(requestparams); string messageCSV = service.ExecuteAction(CSession.CLIENT_KEY, CXML.HtmlEnCode(requestparams)); IList <FWS.TTDKGDTS.ImportTool.BusinessObject.CApplicationMessage> message = CObjectMapper.FromCSV <FWS.TTDKGDTS.ImportTool.BusinessObject.CApplicationMessage>(messageCSV, 1); if (message[0].Result == null || message[0].Result.ToString().Equals("") || message[0].Result.ToString().Equals("0")) { Message = message[0].Description; //MessageBox.Show(message[0].Description); return(false); } return(true); }
public void InitControl(string RefNo, int refType) { InitGridColumn(); RefType = refType; if (RefType == 26) { return; } //Kiem tra don co bi Block khong string inputValue = string.Format("<RequestParams Function='Transaction_Asset' Action=\"CheckAssetBlock\" RefType=\"21\" RefNo='{0}'/>", RefNo); inputValue = CXML.AddAuthenticate(inputValue); string datacsv = CServiceReference.CoreService.ExecuteAction(CSession.CLIENT_KEY, CXML.HtmlEnCode(inputValue)); IList <CApplicationMessage> mess = CObjectMapper.FromCSV <CApplicationMessage>(datacsv, 1); if (mess != null && mess.Count > 0) { if (string.IsNullOrEmpty(mess[0].Result.ToString()) || mess[0].Result.Equals("0")) { MessageBox.Show(mess[0].Description); } } else { MessageBox.Show("Có lỗi khi kiểm tra phong tỏa tài sản."); } //Lay du lieu tu so don dang ky //CCoreService service = new CCoreService(); inputValue = string.Format("<RequestParams Function='GetTransaction_Asset' RefType='21' RefNo='{0}' Status='0,1' />", RefNo); inputValue = inputValue + string.Format("<RequestParams Function='GetTransaction_Asset' RefType='21' RefNo='{0}' Context='WarranterList'/>", RefNo); inputValue = inputValue + string.Format("<RequestParams Function='GetTransaction_Asset' RefType='21' RefNo='{0}' Context='AssetOwnerList'/>", RefNo); datacsv = CServiceReference.CoreService.GetContextData(CSession.CLIENT_KEY, CXML.HtmlEnCode(inputValue)); IList <CTransaction> trans = CObjectMapper.FromCSV <CTransaction>(datacsv, 1); List <Person> warranter = CObjectMapper.FromCSV <Person>(datacsv, 2); List <Person> assetownner = CObjectMapper.FromCSV <Person>(datacsv, 3); if (warranter == null) { warranter = new List <Person>(); } if (assetownner == null) { assetownner = new List <Person>(); } if (trans.Count > 0) { trans[0].ReceiveDateTime = trans[0].ReceiveDateTime <= new DateTime(1901, 01, 01) ? trans[0].RefDate : trans[0].ReceiveDateTime; txtRefNo.Text = trans[0].RefNo; txtReceiveHour.Text = trans[0].ReceiveDateTime.Hour.ToString(); txtReceiveMin.Text = trans[0].ReceiveDateTime.Minute.ToString(); txtReceiveDay.Text = trans[0].ReceiveDateTime.Day.ToString(); txtReceiveMonth.Text = trans[0].ReceiveDateTime.Month.ToString(); txtReceiveYear.Text = trans[0].ReceiveDateTime.Year.ToString(); //txtReceiveDateTime.Value = trans[0].ReceiveDateTime<new DateTime(1901,01,01)?DateTime.Now:trans[0].ReceiveDateTime; txtNumPagesAttachment.Value = trans[0].NumPagesAttachment <= 0 ? 2 : trans[0].NumPagesAttachment; //txtIDNo.Text = trans[0].AssetIDCardNo; txtPersonalCode.Text = trans[0].AssetPersonalCode; CurrentTransaction = trans[0]; CurrentTransaction.WarranterList = warranter; CurrentTransaction.AssetOwnnerList = assetownner; txtOrgRefNo.Text = trans[0].OldRefNo; txtNumber.Text = trans[0].SoDonNhan; txtEmail.Text = trans[0].SendGCNEmail; //gia lap //trans[0].FileNumber = "1024.pdf"; lbAttachName.Text = trans[0].RefNo + ".pdf"; CheckFileExists(); BindingSource source = new BindingSource(); source.DataSource = CurrentTransaction.WarranterList; grWarranter.DataSource = source; BindingSource ownnersource = new BindingSource(); ownnersource.DataSource = CurrentTransaction.AssetOwnnerList; grAssetOwnner.DataSource = ownnersource; //Neu la don Xoa thi khong hien thi Ma ca nhan if (trans[0].Type == 95) { pnPesonalCode.Visible = false; } else { pnPesonalCode.Visible = true; } } }
private void GetInfoByOriginalRefNo(string OrgRefNo) { if (string.IsNullOrEmpty(OrgRefNo)) { return; } CCoreService service = new CCoreService(); string inputValue = string.Format("<InputValue UserID=\"{1}\" /><RequestParams Function='GetTransaction_Asset' RefType='22' RegisTransRefNo='{0}'/>", OrgRefNo, CSession.UserID); inputValue = inputValue + string.Format("<RequestParams Function=\"GetTransaction_Asset\" RefType=\"21\" RefNo=\"{0}\" Context=\"AssetOwnerList\"/>", OrgRefNo); inputValue = inputValue + string.Format("<RequestParams Function=\"GetTransaction_Asset\" RefType=\"21\" RefNo=\"{0}\" Context=\"AssetOwnerList\"/>", CurrentTransaction.RefNo); inputValue = inputValue + string.Format("<RequestParams Function=\"GetTransaction_Asset\" RefType=\"21\" RefNo=\"{0}\" Context=\"WarranterList\"/>", OrgRefNo); inputValue = inputValue + string.Format("<RequestParams Function=\"GetTransaction_Asset\" RefType=\"21\" RefNo=\"{0}\" Context=\"WarranterList\"/>", CurrentTransaction.RefNo); string datacsv = service.GetContextData(CSession.CLIENT_KEY, CXML.HtmlEnCode(inputValue)); IList <CTransaction> trans = CObjectMapper.FromCSV <CTransaction>(datacsv, 1); List <Person> OrgAssetOwner = CObjectMapper.FromCSV <Person>(datacsv, 2); if (OrgAssetOwner == null) { OrgAssetOwner = new List <Person>(); } List <Person> AssetOwner = CObjectMapper.FromCSV <Person>(datacsv, 3); if (AssetOwner == null) { AssetOwner = new List <Person>(); } List <Person> OrgWarraner = CObjectMapper.FromCSV <Person>(datacsv, 4); if (OrgWarraner == null) { OrgWarraner = new List <Person>(); } List <Person> Warraner = CObjectMapper.FromCSV <Person>(datacsv, 5); if (Warraner == null) { Warraner = new List <Person>(); } if (trans != null && trans.Count > 0) { if (string.IsNullOrEmpty(txtPersonalCode.Text)) { txtPersonalCode.Text = trans[0].AssetPersonalCode; } //txtAssetType.SelectedValue = trans[0].AssetType.ToString(); //txtDirection.SelectedValue = trans[0].ObjectID; //txtCQCN.SelectedValue = trans[0].ObjectID; if (Warraner == null || Warraner.Count == 0) { CurrentTransaction.WarranterList = OrgWarraner; BindingSource source = new BindingSource(); source.DataSource = CurrentTransaction.WarranterList; grWarranter.DataSource = source; } if (AssetOwner == null || AssetOwner.Count == 0) { CurrentTransaction.AssetOwnnerList = OrgAssetOwner; BindingSource source = new BindingSource(); source.DataSource = CurrentTransaction.AssetOwnnerList; grAssetOwnner.DataSource = source; } //CurrentTransaction.AssetOwnnerList = asset; } }