public void Generate() { var generateService = new GenerateService(); generateService.Generate(this.requestClassName, this.appRequestNamespace, this.namespaceList, this.requestPathUrl, TypeAttributes.Public | TypeAttributes.Class, false, false, this.baseRequestClassName); generateService.Generate(this.responseClassName, this.appResponseNamespace, this.namespaceList, this.responsePathUrl, TypeAttributes.Public | TypeAttributes.Class, false, false, this.baseResponseClassName); }
public void Generate() { var constructorStr = $@"var crmService = StartupHelper.CreateCrmService(); {repositoryinterfaceName} {repositoryClassName.ToLower()} = new {repositoryClassName}(); {serviceinterfaceName} {serviceClassName.ToLower()} = new {serviceClassName}(crmService, {repositoryClassName.ToLower()}); {appinterfaceName} app = new {appClassName}({serviceClassName.ToLower()}); return Task.FromResult(app);"; var generateService = new GenerateService(); generateService.Generate(this.className, this.appNamespace, this.namespaceList, this.pathUrl, TypeAttributes.Public | TypeAttributes.Class, constructorStr, this.interfaceName, this.returnType); }
public IActionResult GenerateHome() { //GenerateHome gen = new GenerateHome(); //gen.GenerateHomeHtml(); GenerateService generate = new GenerateService(); generate.GenerateHtml(0, 0, 0); var result = new ResultAdaptDto(); return(Json(result)); }
public IActionResult Channel(int channelId, int page = 1) { //GenerateChannel generateChannel = new GenerateChannel(); //var ret = generateChannel.GenerateChannelHtml(channelId, page); GenerateService generate = new GenerateService(); var ret = generate.GenerateHtml(0, channelId, page); if (!ret.Status) { return(Redirect("/404.html")); } return(Html(ret.Html)); }
public IActionResult Index(int channelId, int id) { if (id == 0) { return(Redirect("/404.html")); } //GenerateContent gen = new GenerateContent(); //var ret = gen.GenerateContentHtml(channelId,id); //if (!ret.genStatus) //{ // return Redirect("/404.html"); //} GenerateService generate = new GenerateService(); var ret = generate.GenerateHtml(id, 0, 0); if (!ret.Status) { return(Redirect("/404.html")); } return(Html(ret.Html)); }
private void btnCheckFiles_Click(object sender, EventArgs e) { btnEncode.Enabled = false; GenerateService.CheckPaths(); if (txtBoxBatchNo.Text.ToUpper() != "0000") { if (dteDeliveryDate.Value.ToShortDateString() == DateTime.Today.ToShortDateString()) { DialogResult result3 = MessageBox.Show("Please select Delivery Date", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); dteDeliveryDate.Focus(); //return; } else if (txtBoxBatchNo.Text == "") { DialogResult result3 = MessageBox.Show("Please input Batch No: ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); dteDeliveryDate.Focus(); return; } else if (txtBoxProcessBy.Text == "") { DialogResult result3 = MessageBox.Show("Please input Process by: ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); dteDeliveryDate.Focus(); return; } } if (btnCheckFiles.Text == "Check Files on Head") { DialogResult result1 = MessageBox.Show("Are you sure you want to check " + lstFiles.Items.Count + " items?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result1 == DialogResult.No) { return; } //ReturnMe.CreateTable(); List <OrderModel> OrderList = new List <OrderModel>(); int LoopCount = 0; lblStatus.Text = "Now Checking Files in Head Folder . . ."; while (LoopCount < lstFiles.Items.Count) { string filename = lstFiles.Items[LoopCount].ToString(); OrderList.AddRange(CheckFiles(filename)); LoopCount = LoopCount + 1; } CheckBranches(OrderList); DisplayData(OrderList); if (CheckingService.CheckBatchIfDuplicate(txtBoxBatchNo.Text)) { MessageBox.Show("Batch No is already been use ! ! !", "Error"); } else { btnCheckFiles.Text = "Process ! ! !"; MessageBox.Show("Data has been Checked. No Errors found!", " ", MessageBoxButtons.OK, MessageBoxIcon.Information); lblStatus.Text = "Ready . . ."; } if (checkBoxSortRT.Checked == true) { //For Sort RT List <OrderModel> sortTemp = new List <OrderModel>(); sortTemp.AddRange(sortedList.RegularPersonal); sortTemp.AddRange(sortedList.RegularCommercial); GenerateService.GenerateSortRT("Regular", sortTemp); sortTemp = new List <OrderModel>(); sortTemp.AddRange(sortedList.PersonalPreEncoded); sortTemp.AddRange(sortedList.CommercialPreEncoded); GenerateService.GenerateSortRT("Regular\\PreEncoded", sortTemp); GenerateService.GenerateSortRT("MC", sortedList.ManagersCheck); sortTemp = new List <OrderModel>(); sortTemp.AddRange(sortedList.CheckOnePersonal); sortTemp.AddRange(sortedList.CheckOneCommerical); GenerateService.GenerateSortRT("CheckOne", sortTemp); sortTemp = new List <OrderModel>(); sortTemp.AddRange(sortedList.CheckPowerPersonal); sortTemp.AddRange(sortedList.CheckPowerCommercial); GenerateService.GenerateSortRT("CheckPower", sortTemp); GenerateService.GenerateSortRT("GiftCheck", sortedList.GiftCheck); GenerateService.GenerateSortRT("MC\\Continues", sortedList.ManagersCheckCont); MessageBox.Show("SortRT File has been successfully generated", " ", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { btnCheckFiles.Enabled = false; btnEncode.Enabled = false; //GENERATE PRINTER FILES lblStatus.Text = "Generating Printer Files"; Application.DoEvents(); AddSerials(); GenerateService.GeneratePrinterFiles(sortedList, txtBoxBatchNo.Text, txtBoxExt.Text); //GENERATE MDB FILE FOR Manager's Check if (sortedList.ManagersCheck.Count > 0 || sortedList.ManagersCheckCont.Count > 0) { lblStatus.Text = "Generating MDB Files for Manager's Check"; Application.DoEvents(); GenerateService.GenerateMDBFile(sortedList, txtBoxBatchNo.Text, txtBoxExt.Text); } //GENERATE PACKING DBF lblStatus.Text = "Generating Packing DBF Files"; Application.DoEvents(); GenerateService.GeneratePackingDBF(sortedList, txtBoxBatchNo.Text, txtBoxExt.Text); //GENERATE DO BLOCK lblStatus.Text = "Generating DoBlock Files"; Application.DoEvents(); GenerateService.GenerateDoBlock(sortedList, txtBoxBatchNo.Text, txtBoxExt.Text, dteDeliveryDate.Value, txtBoxProcessBy.Text); //GENERATE PACKINGLIST lblStatus.Text = "Generating PackingList Files"; Application.DoEvents(); GenerateService.GeneratePackingList(sortedList, txtBoxBatchNo.Text, dteDeliveryDate.Value, branchList); if (txtBoxBatchNo.Text != "0000") { //SAVE HISTORY lblStatus.Text = "Saving History"; Application.DoEvents(); BackupService.SaveHistory(sortedList, txtBoxBatchNo.Text, txtBoxExt.Text, dteDeliveryDate.Value); //SAVE NEW SERIES ON DATABASE lblStatus.Text = "Saving New Serial in Database . . ."; Application.DoEvents(); BackupService.SaveNewSeries(branchList); //WinZIP Process lblStatus.Text = "Archiving Output Files . . ."; Application.DoEvents(); BackupService.ProcessArchiving(AutoBatch, txtBoxProcessBy.Text, sortedList); DeleteHeadFiles();//DELETE FILES IN HEAD FOLDER } lblStatus.Text = "Processing Done. . ."; MessageBox.Show("Processing Done . . .", " ", MessageBoxButtons.OK, MessageBoxIcon.Information); } }//END OF FUNCTION
private void btnProcess_Click(object sender, EventArgs e) { sbtcList.RegularPersonal = new List <OrderModel>(); sbtcList.RegularCommercial = new List <OrderModel>(); sbtcList.ManagersCheck = new List <OrderModel>(); sbtcList.ManagersCheckCont = new List <OrderModel>(); sbtcList.GiftCheck = new List <OrderModel>(); sbtcList.PersonalPreEncoded = new List <OrderModel>(); sbtcList.CommercialPreEncoded = new List <OrderModel>(); sbtcList.CheckOnePersonal = new List <OrderModel>(); sbtcList.CheckOneCommerical = new List <OrderModel>(); sbtcList.CheckPowerPersonal = new List <OrderModel>(); sbtcList.CheckPowerCommercial = new List <OrderModel>(); sbtcList.DigiBanker = new List <OrderModel>(); sbtcList.CustomizedCheck = new List <OrderModel>(); for (int LoopCount = 0; LoopCount < dataGridView1.Rows.Count; LoopCount++) { string chequename = dataGridView1.Rows[LoopCount].Cells[0].Value.ToString(); string brstn = dataGridView1.Rows[LoopCount].Cells[1].Value.ToString(); string AccountNo = dataGridView1.Rows[LoopCount].Cells[2].Value.ToString(); string Name1 = dataGridView1.Rows[LoopCount].Cells[3].Value.ToString(); string Name2 = dataGridView1.Rows[LoopCount].Cells[4].Value.ToString(); int Books = int.Parse(dataGridView1.Rows[LoopCount].Cells[5].Value.ToString()); string StartingSerial = dataGridView1.Rows[LoopCount].Cells[6].Value.ToString(); OrderModel sbtc = new OrderModel(); for (int x = 0; x < Books; x++) { sbtc = new OrderModel(); sbtc.CheckType = chequename; sbtc.BRSTN = brstn; sbtc.AccountNo = AccountNo; sbtc.Name = Name1; sbtc.Name2 = Name2; sbtc.FormType = "00"; sbtc.OrderQuantity = Books; sbtc.ManualStart = int.Parse(StartingSerial); if (chequename == "CUSTOM") { sbtcList.CustomizedCheck.Add(sbtc); } else if (chequename == "DIGIBANKER") { sbtcList.DigiBanker.Add(sbtc); } else if (chequename == "CUSTOM_PA") { sbtcList.CustomizedCheckPersonal.Add(sbtc); } } } if (sbtcList.CustomizedCheck.Count > 0) { AssignOtherValue(sbtcList.CustomizedCheck); AssignSeriels("CUSTOM"); } if (sbtcList.DigiBanker.Count > 0) { AssignOtherValue(sbtcList.DigiBanker); AssignSeriels("DIGIBANKER"); } btnAdd.Enabled = false; btnProcess.Enabled = false; //PrinterFile GenerateService.GeneratePrinterFiles(sbtcList, txtBoxBatchNo.Text, txtBoxExt.Text); //DoBlock GenerateService.GenerateDoBlock(sbtcList, txtBoxBatchNo.Text, txtBoxExt.Text, dteDeliveryDate.Value, ""); //PackingList GenerateService.GeneratePackingList(sbtcList, txtBoxBatchNo.Text, dteDeliveryDate.Value, branchList); //PackingDBF GenerateService.GeneratePackingDBF(sbtcList, txtBoxBatchNo.Text, txtBoxExt.Text); }