public static List <Dividend> Get_DividendList_CR(string CUSIP, DateTime recordDate, DividendTable_option table = DividendTable_option.Dividend_Control_Approved) { List <Dividend> all_List = Helper_Dividend.Get_DividendList_CUSIP(CUSIP, table); List <Dividend> res_list = new List <Dividend>(); foreach (Dividend dvd in all_List) { int val = HssDateTime.CompareDateTime_day(recordDate, dvd.RecordDate_ADR.Value); if (val == 0) { res_list.Add(dvd); } } return(res_list); }
/// <summary> /// Used in DARWIN\UserControls\XBRLApproval.vb for JIRA: DRWIN-166 /// Handle XBRL cancelled files /// </summary> /// <returns> /// less than 0: stop parsing XBRL /// greater than or equal 0: go on parsing XBRL /// </returns> public static int DealWith_Dividend_XBRL(string referenceNumber, bool xbrl_cancelled, ref Dividend currDividend) { currDividend = Helper_Dividend.GetDividend_XBRL_refNum(referenceNumber); if (currDividend == null) { if (xbrl_cancelled) { return(-1); } else { return(2); } } if (Helper_hssStatus.Str_to_Status(currDividend.Status.Value) == HssStatus.Cancel) { if (xbrl_cancelled) { MessageBox.Show("Dividend " + currDividend.DividendIndex + " already cancelled"); return(-2); } else { string msg = "Dividend " + currDividend.DividendIndex + "has been cancelled.\nDo you want to reinstate it and approve it?"; if (MessageBox.Show(msg, "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes) { return(1); } else { return(-3); } } } else { if (xbrl_cancelled) { Helper_Dividend.CancelDivdiend(currDividend); MessageBox.Show("Dividend " + currDividend.DividendIndex + " is cancelled"); return(-4);//need to move XBRL to Approved tab } } return(0); }
public void Init_from_CUSIP(string CUSIP) { List <Dividend> dvdList = Helper_Dividend.Get_DividendList_CUSIP(CUSIP); this.Init_from_list(dvdList); }