public static string FormatDateHNAC(string dt) { string str = ""; if (HuronRoutines.IsDate(dt)) { DateTime dttime = DateTime.Parse(dt); string day = String.Format("{0:00}", dttime.Day); string month = String.Format("{0:00}", dttime.Month); string year = String.Format("{0:0000}", dttime.Year); str = year + month + day; } return(str); }
public static string CheckInsurance(string ins, string mapIns, int flg, bool returnMapValue, string dupIns) { bool isDuplicate = false; bool is4 = false; string insurance = ""; string insItem = ""; string insNbr = ""; string num = ""; int nbr = 0; if (flg == 1) { InsDict.Clear(); } if (ins.Trim() == "") { return(""); } else if (mapIns.Trim() == ins) { num = ins.Substring(0, 3); if (HuronRoutines.IsNumeric(num) == true) { if (int.Parse(num) >= 100 && int.Parse(num) < 200) { dupIns = "co"; insItem = "ZCONV.CO"; } else if (int.Parse(num) >= 200 && int.Parse(num) < 300) { dupIns = "mr"; insItem = "ZCONV.MR"; } else if (int.Parse(num) >= 300 && int.Parse(num) < 400) { dupIns = "co"; insItem = "ZCONV.CO"; } else if (int.Parse(num) >= 400 && int.Parse(num) < 500) { dupIns = "bc"; insItem = "ZCONV.BC"; } else if (int.Parse(num) >= 500 && int.Parse(num) < 600) { dupIns = "bs"; insItem = "ZCONV.BS"; } else if (int.Parse(num) >= 600 && int.Parse(num) < 650) { dupIns = "hm"; insItem = "ZCONV.HM"; } else if (int.Parse(num) >= 650 && int.Parse(num) < 700) { dupIns = "co"; insItem = "ZCONV.CO"; } else if (int.Parse(num) >= 700 && int.Parse(num) < 750) { dupIns = "mc"; insItem = "ZCONV.MC"; } else if (int.Parse(num) >= 750 && int.Parse(num) < 800) { dupIns = "mc"; insItem = "ZCONV.MC"; } else if (int.Parse(num) >= 800 && int.Parse(num) < 900) { dupIns = "ch"; insItem = "ZCOMV.CH"; } else if (int.Parse(num) >= 900) { dupIns = "wc"; insItem = "ZCONV.WC"; } else { insItem = ins; } mapIns = insItem; } else { insItem = ins; } } else { insItem = mapIns; } if (InsDict.Contains(insItem) == true) { isDuplicate = true; insNbr = InsDict[insItem].ToString(); InsDict.Remove(insItem); if (dupIns.Trim() == "") { nbr = int.Parse(insNbr) + 1; insurance = "OTH" + "." + nbr.ToString(); InsDict.Add(insItem, nbr); } else { nbr = int.Parse(insNbr) + 1; insurance = dupIns + "." + nbr.ToString(); InsDict.Add(insItem, nbr); } if (InsDict.Contains(dupIns) == true) { insNbr = InsDict[dupIns].ToString(); nbr = int.Parse(insNbr) + 1; insurance = dupIns + "." + nbr.ToString(); InsDict.Remove(dupIns); InsDict.Add(dupIns, nbr); } else { InsDict.Add(dupIns, nbr); } } if (isDuplicate == false) { if (returnMapValue == true) { if (mapIns.Trim() == ins) { insurance = ins; } else { insurance = mapIns; } } else { insurance = ins; } if (mapIns.Trim() == ins) { if (is4 == true) { if (InsDict.Contains("ZCONV+") == false) { InsDict.Add("ZCONV+", 1); } } else { if (InsDict.Contains(ins) == false) { InsDict.Add(ins, 1); } } } else { if (InsDict.Contains(mapIns) == false) { InsDict.Add(mapIns, 1); } } } return(insurance); }