public void CreateCard() { var p = new processes(card_sa7ab.card.process); types types = new types(); foreach (p_sa7ab pr in card_sa7ab.p_sa7ab) { types.insert(pr.part.num_type, pr.cost); } types.leadData(Data); Data["F9"] = p.Name; Data["F11"] = " سحب المبلغ الملتزم به غير المسدد للعملية الى غاية: 31/ 12/ " + p.process.cards.ToList().LastOrDefault().year1.year1.Year; // Data["F11"] = "أخذ بالحساب رقم للمقرر رقم "+p.process.num+" المؤرخ بتاريخ "+p.process.date.ToShortDateString(); ///////////////// start top section //////////// Data["Z4"] = p.code_.NumProsess[0] + ""; Data["Y4"] = p.code_.NumProsess[1] + ""; Data["R4"] = p.code_.Subject + ""; Data["Q4"] = p.code_.chapter[0] + ""; Data["P4"] = p.code_.chapter[1] + ""; Data["O4"] = p.code_.chapter[2] + ""; Data["N4"] = p.code_.NK[2] + ""; Data["M4"] = p.code_.NK[0].ToString().ToUpper(); Data["L4"] = p.code_.NK[1].ToString().ToUpper(); string year = card_sa7ab.card.year1.year1.Year.ToString(); Data["G4"] = year.ElementAt(2) + ""; Data["F4"] = year.ElementAt(3) + ""; string a = card_sa7ab.card.num + ""; switch (a.Length) { case 1: Data["J4"] = "0"; Data["I4"] = "0"; Data["H4"] = a.ElementAt(0) + ""; break; case 2: Data["J4"] = "0"; Data["I4"] = a.ElementAt(0) + ""; Data["H4"] = a.ElementAt(1) + ""; break; case 3: Data["J4"] = a.ElementAt(0) + ""; Data["I4"] = a.ElementAt(1) + ""; Data["H4"] = a.ElementAt(2) + ""; break; } /////////////////// finsh top section ////////////// Data["G32"] = card_sa7ab.card + ""; Data["E36"] = card_sa7ab.card + ""; Data["B36"] = card_sa7ab.old_cost + ""; Data["L36"] = (card_sa7ab.old_cost + card_sa7ab.cost) + ""; ExcelHlper excelHlper = new ExcelHlper("sa7ab_Template", new string[] { "p" }); excelHlper.EditMenyCell("p", Data); excelHlper.SaveAs(card_sa7ab.card.location); excelHlper.Close(); }
public void CreateCard() { var p = new processes(card_7isab.card.process); types types = new types(); double Allcost = 0; foreach (part pr in p.process.parts.ToList()) { types.insert(pr.num_type, pr.Cost); Allcost += pr.Cost; } types.leadData(Data); Data["F9"] = p.Name; Data["F11"] = "أخذ بالحساب رقم للمقرر رقم " + p.process.num + " المؤرخ بتاريخ " + p.process.date.ToShortDateString(); ///////////////// start top section //////////// Data["Z4"] = p.code_.NumProsess[0] + ""; Data["Y4"] = p.code_.NumProsess[1] + ""; Data["R4"] = p.code_.Subject + ""; Data["Q4"] = p.code_.chapter[0] + ""; Data["P4"] = p.code_.chapter[1] + ""; Data["O4"] = p.code_.chapter[2] + ""; Data["N4"] = p.code_.NK[2] + ""; Data["M4"] = p.code_.NK[0].ToString().ToUpper(); Data["L4"] = p.code_.NK[1].ToString().ToUpper(); string year = card_7isab.card.year1.year1.Year.ToString(); Data["G4"] = year.ElementAt(2) + ""; Data["F4"] = year.ElementAt(3) + ""; string a = card_7isab.card.num + ""; switch (a.Length) { case 1: Data["J4"] = "0"; Data["I4"] = "0"; Data["H4"] = a.ElementAt(0) + ""; break; case 2: Data["J4"] = "0"; Data["I4"] = a.ElementAt(0) + ""; Data["H4"] = a.ElementAt(1) + ""; break; case 3: Data["J4"] = a.ElementAt(0) + ""; Data["I4"] = a.ElementAt(1) + ""; Data["H4"] = a.ElementAt(2) + ""; break; } /////////////////// finsh top section ////////////// Data["G32"] = Allcost + ""; Data["E36"] = Allcost + ""; Data["L36"] = Allcost + ""; ExcelHlper excelHlper = new ExcelHlper("7isab_Template", new string[] { "p" }); excelHlper.EditMenyCell("p", Data); excelHlper.SaveAs(card_7isab.card.location); excelHlper.Close(); }