using System.Collections.Generic;
using NPOI.XSSF.UserModel;
using NPOI.POIFS.FileSystem;
public static void Main()
DefaultProject TP = new DefaultProject();
Dictionary<int, string> dic1 = TP.WriteOnline();
Dictionary<int, string> dic2 = TP.WriteValue();
string filePath1 = @"C:\Users\helen.wu\Desktop\SOFT Project Tracking HUB\NVIDIA_Online_Tracker_Template.xlsx";
string filePath2 = @"C:\Users\helen.wu\Desktop\SOFT Project Tracking HUB\Helen_All_Projects.xlsx";
TP.SaveExcel(filePath1, dic1);
TP.SaveExcel(filePath2, dic2);
public class DefaultProject
public int TotalCounts = 0;
public DateTime DTCreationDate = DateTime.Now;
public String STCreationDate = DateTime.Now.ToString("MM/dd/yyyy");
falconid = "nvidia_" + this.DTCreationDate.ToString("yyMM") + "_" + value;
jiraid = "TRAN-" + value;
public string ProjectName
public string Status = "Pending";
public void SaveExcel(string filePath, Dictionary<int, string> dic)
FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.ReadWrite);
IWorkbook wb = new XSSFWorkbook(file);
ISheet sht = wb.GetSheet("sheet1");
int newrowNum = sht.LastRowNum + 1;
IRow row = sht.CreateRow(newrowNum);
for (int i = 0; i < dic.count; i++)
cell = row.CreateCell(i);
cell.SetCellValue(dic[i]);
FileStream file2 = new FileStream(filePath, FileMode.Create);
public Dictionary<int, string> WriteOnline()
string[] header = {"WL Project Code", "JIRA ID", "Requestor", "Region", "Requested Date", "File name/Email subject", "Satuts", "Complete Month", "Product", "Type", "Word Count", "Quote - Total"};
string[] cV = new string[12];
cV[4] = this.STCreationDate;
cV[5] = this.ProjectName;
cV[10] = this.WordCounts;
Dictionary<int, string> writeRow = new Dictionary<int, string>();
for (int n = 0; n < 12; n++)
public override Dictionary<int, string> WriteValue()
string[] header = {"No.", "Status", "Create Date", "Falcon ID", "JIRA ID", "GS ID", "Project Name", "Word Counts", "Amounts"};
string[] cV = new string[9];
cV[0] = this.TotalCounts.ToString();
cV[2] = this.STCreationDate;
cV[6] = this.ProjectName;
Dictionary<int, string> writeRow = new Dictionary<int, string>();
for (int n = 0; n < 9; n++)
Console.WriteLine("Type 1 for DMO, 2 for Blog.");
string type = Console.ReadLine();
Console.WriteLine("JIRA ID");
this.JIRAID = Console.ReadLine();
Console.WriteLine("GS ID");
this.GSID = Console.ReadLine();
Console.WriteLine("Project Name");
this.ProjectName = Console.ReadLine();
Console.WriteLine("Falcon ID");
this.FalconID = Console.ReadLine();
Console.WriteLine("Type 1 for Wilson, 2 for Mengdi");
string requestor = Console.ReadLine();
this.Requestor = "Wilson";
this.Requestor = "Mengdi";
public virtual void Calculate()
Dictionary<string, double> NVQuote1 = new Dictionary<string, double>();
NVQuote1.Add("100%", 0.025);
NVQuote1.Add("95% - 99%", 0.04);
NVQuote1.Add("85% - 94%", 0.05);
NVQuote1.Add("75% - 84%", 0.065);
NVQuote1.Add("No Match", 0.09);
NVQuote1.Add("Repetitions", 0.025);
NVQuote1.Add("In Context Matches", 0.025);
NVQuote1.Add("MT", 0.09);
foreach (string key in NVQuote1.Keys)
int detailedWC = Convert.ToInt32(Console.ReadLine());
money += detailedWC * NVQuote1[key];
money = Math.Round(money, 2, MidpointRounding.AwayFromZero);
this.WordCounts = totalWC.ToString();
this.Amounts = money.ToString();