public void UpdateEmployee() { Console.WriteLine("\n\n"); Console.WriteLine(ResourceCulture.GetString("UpdateInfo")); Employee employeeItem = new Employee(); CommonEntity eommonEntity = new CommonEntity(); bool valid = false; string inputId = null; Console.WriteLine(ResourceCulture.GetString("IdInputTips")); inputId = Console.ReadLine().Trim(); while (!valid) { valid = eommonEntity.IsValidId(inputId); if (!valid) { Console.WriteLine(ResourceCulture.GetString("IdInputError")); inputId = Console.ReadLine().Trim(); } } employeeItem.EmployeeId = Convert.ToInt32(inputId); List <Employee> searchedEmployee = new EmployeeEntity().PreciceSearchEmployee(employeeItem.EmployeeId); if (searchedEmployee == null) { Console.WriteLine(ResourceCulture.GetString("SearchedZeroInfo") + "\n"); } else { new EmployeePage().DisplayEmployee(searchedEmployee); GetToUpdateEmployeeDetail(searchedEmployee[0]); } }
public string Post([FromBody] CommodityParameter commodity) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDATE", commodity.FDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", commodity.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@Godcode", commodity.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", commodity.RCode)); sqlParameters.Add(new KeyValuePair <string, string>("@ScCode", commodity.TRCode)); ds = manageSQLConnection.GetDataSetValues("GetSchemeIssueMemo", sqlParameters); SchemeIssueMemo schemeIssue = new SchemeIssueMemo(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = commodity.GCode, FromDate = commodity.FDate, Todate = commodity.ToDate, UserName = commodity.UserName }; Task.Run(() => schemeIssue.GenerateSchemeIssueMemoReport(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Post([FromBody] DemandDraftEntity demandDraft) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", demandDraft.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", demandDraft.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", demandDraft.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", demandDraft.RCode)); ds = manageSQLConnection.GetDataSetValues("Get_demanddraftdetails", sqlParameters); ManageDemandDraft manageDemand = new ManageDemandDraft(); ManageReport manageReport = new ManageReport(); //filter condotions if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = demandDraft.GCode, FromDate = demandDraft.FromDate, Todate = demandDraft.ToDate, UserName = demandDraft.UserName, GName = demandDraft.GName, RName = demandDraft.RName }; // commodityIssueMemo.GenerateCommodityIssueMemoReport(entity); Task.Run(() => manageDemand.GenerateDemandDraftReport(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public void CheckPayment(StreamWriter sw, CommonEntity entity, string coop) { DataTable dataTable = new DataTable(); dataTable = entity.dataSet.Tables[1]; DataRow[] drRows = entity.dataSet.Tables[1].Select("Coop='" + coop + "'"); int count = drRows.Count(); sw.WriteLine("-----------------------------------------------------------------------------------------------------------------------------------------"); if (count > 0) { sw.Write(report.StringFormatWithoutPipe("", 36, 2)); sw.Write(report.StringFormatWithoutPipe("", 10, 2)); sw.Write(report.StringFormatWithoutPipe("", 15, 2)); sw.Write(report.StringFormatWithoutPipe(" ", 11, 1)); sw.Write(report.StringFormatWithoutPipe("Collection Amount", 23, 1)); sw.Write(report.StringFormatWithoutPipe(" ", 10, 1)); sw.Write(report.StringFormatWithoutPipe(" ", 11, 1)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(drRows[0]["PaymentAmount"])), 11, 1)); sw.WriteLine(""); } else { sw.WriteLine(" Payment not Found "); } sw.WriteLine("-----------------------------------------------------------------------------------------------------------------------------------------"); }
public Tuple <bool, string> Post([FromBody] ReportParameter reportParameter) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", reportParameter.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", reportParameter.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", reportParameter.GCode)); ds = manageSQLConnection.GetDataSetValues("GetGSTData", sqlParameters); ManageGST manageGST = new ManageGST(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = reportParameter.GCode, FromDate = reportParameter.FromDate, Todate = reportParameter.ToDate, UserName = reportParameter.UserName, Type = reportParameter.Type }; return(manageGST.GenerateGSTFile(entity)); //Generate the Report } return(new Tuple <bool, string>(false, "GST File is not generated")); }
/// <summary> /// /// </summary> /// <param name="entity"></param> public void GenerateDOMarginReport(CommonEntity entity) { string fPath = string.Empty, subF_Path = string.Empty, fileName = string.Empty, filePath = string.Empty; StreamWriter streamWriter = null; try { fileName = entity.GCode + GlobalVariable.DOMarginReportFileName; fPath = GlobalVariable.ReportPath + "Reports"; report.CreateFolderIfnotExists(fPath); // create a new folder if not exists subF_Path = fPath + "//" + entity.UserName; //ManageReport.GetDateForFolder(); report.CreateFolderIfnotExists(subF_Path); //delete file if exists filePath = subF_Path + "//" + fileName + ".txt"; report.DeleteFileIfExists(filePath); streamWriter = new StreamWriter(filePath, true); DateWiseCommodityIssueMemoReport(streamWriter, entity); //List<CommodityIssueMemoEntity> commodityIssueList = new List<CommodityIssueMemoEntity>(); //commodityIssueList = report.ConvertDataTableToList<CommodityIssueMemoEntity>(entity.dataSet.Tables[0]); streamWriter.Flush(); } catch (Exception ex) { AuditLog.WriteError(ex.Message + " " + ex.StackTrace); } finally { streamWriter.Close(); fPath = string.Empty; fileName = string.Empty; streamWriter = null; } }
public string Post([FromBody] PurchaseParameter reportParameter) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDATE", reportParameter.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", reportParameter.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@Godcode", reportParameter.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@orderno", reportParameter.OrderNo)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", reportParameter.RCode)); ds = manageSQLConnection.GetDataSetValues("Getrono", sqlParameters); RoNoController RoNoPurchase = new RoNoController(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = reportParameter.GCode, FromDate = reportParameter.FromDate, Todate = reportParameter.ToDate, UserName = reportParameter.UserName }; Task.Run(() => RoNoPurchase.GenerateRoNoPurchase(entity)); } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Get(string FDate, string ToDate, string GCode, string UserName, string RCode) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDate", FDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@Godcode", GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", RCode)); ds = manageSQLConnection.GetDataSetValues("GetHullingDetails", sqlParameters); HullingDetails hullingDetails = new HullingDetails(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = GCode, FromDate = FDate, Todate = ToDate, UserName = UserName }; Task.Run(() => hullingDetails.GenerateHullingReport(entity)); } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Post(DeliveryOrderSchemeWiseEntity marginAmount) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", marginAmount.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", marginAmount.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", marginAmount.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", marginAmount.RCode)); ds = manageSQLConnection.GetDataSetValues("GetDeliveryOrderMarginAmount", sqlParameters); ManageDOMargin manageDOMargin = new ManageDOMargin(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = marginAmount.GCode, FromDate = marginAmount.FromDate, Todate = marginAmount.ToDate, UserName = marginAmount.UserName, GName = marginAmount.GName, RName = marginAmount.RName }; // commodityIssueMemo.GenerateCommodityIssueMemoReport(entity); Task.Run(() => manageDOMargin.GenerateDOMarginReport(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Post([FromBody] OCREntity oCREntity) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", oCREntity.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", oCREntity.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GCode", oCREntity.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", oCREntity.RCode)); ds = manageSQLConnection.GetDataSetValues("GetOCRReport", sqlParameters); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { ManageOCRReport manageOCR = new ManageOCRReport(); CommonEntity entity = new CommonEntity { dataSet = ds, GCode = oCREntity.GCode, FromDate = oCREntity.FromDate, Todate = oCREntity.ToDate, UserName = oCREntity.UserID, GName = oCREntity.GName, RName = oCREntity.RName }; Task.Run(() => manageOCR.GenerateOCRReport(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Get(string FDate, string ToDate, string GCode, string Username, string RCode) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDate", FDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GCode", GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", RCode)); ds = manageSQLConnection.GetDataSetValues("GetTransitdetails", sqlParameters); ManageTruckTransit manageTruckToRegion = new ManageTruckTransit(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = GCode, FromDate = FDate, Todate = ToDate, UserName = Username, GName = ds.Tables[0].Rows[0]["TNCSName"].ToString(), RName = ds.Tables[0].Rows[0]["Region"].ToString() }; Task.Run(() => manageTruckToRegion.GenerateTruckTransit(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Post(DeliveryOrderSchemeWiseEntity SchemeWise) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", SchemeWise.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", SchemeWise.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", SchemeWise.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@Schcode", SchemeWise.SchCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", SchemeWise.RCode)); ds = manageSQLConnection.GetDataSetValues("GetDeliveryOrdersOtherScheme", sqlParameters); ManageDOOthers manageDOSPLPDS = new ManageDOOthers(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = SchemeWise.GCode, FromDate = SchemeWise.FromDate, Todate = SchemeWise.ToDate, UserName = SchemeWise.UserName, GName = SchemeWise.GName, RName = SchemeWise.RName }; // manageDOAllScheme.GenerateDOAllSchemeReport(entity); Task.Run(() => manageDOSPLPDS.GenerateDOOthersScheme(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
/// <summary> /// /// </summary> /// <param name="entity"></param> public Tuple <bool, string> GenerateGSTFile(CommonEntity entity) { string fPath = string.Empty, subF_Path = string.Empty, fileName = string.Empty, filePath = string.Empty; StreamWriter streamWriter = null; try { fileName = entity.GCode + GlobalVariable.GSTFileName; fPath = GlobalVariable.ReportPath + "Reports"; report.CreateFolderIfnotExists(fPath); // create a new folder if not exists subF_Path = fPath + "//" + entity.UserName; //ManageReport.GetDateForFolder(); report.CreateFolderIfnotExists(subF_Path); //delete file if exists filePath = subF_Path + "//" + fileName + ".txt"; report.DeleteFileIfExists(filePath); streamWriter = new StreamWriter(filePath, true); CreateGSTTextFile(streamWriter, entity); streamWriter.Flush(); return(new Tuple <bool, string>(true, "GST File is Generated Sccessfully!")); } catch (Exception ex) { AuditLog.WriteError(ex.Message + " " + ex.StackTrace); return(new Tuple <bool, string>(false, "GST File is not Generated!")); } finally { streamWriter.Close(); fPath = string.Empty; fileName = string.Empty; streamWriter = null; } }
public string Post([FromBody] CommodityParameter commodity) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDate", commodity.FDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", commodity.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodCode", commodity.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", commodity.RCode)); sqlParameters.Add(new KeyValuePair <string, string>("@TRCODE", commodity.TRCode)); ds = manageSQLConnection.GetDataSetValues("GetTransactionReceipt", sqlParameters); TransactionReceipt stockDeliveryOrder = new TransactionReceipt(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = commodity.GCode, FromDate = commodity.FDate, Todate = commodity.ToDate, UserName = commodity.UserName }; Task.Run(() => stockDeliveryOrder.GenerateTransactionReceipt(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Post([FromBody] CommodityParameter commodity) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDate", commodity.FDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", commodity.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@Godcode", commodity.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", commodity.RCode)); sqlParameters.Add(new KeyValuePair <string, string>("@TRCODE", commodity.TRCode)); sqlParameters.Add(new KeyValuePair <string, string>("@ITCode", commodity.ITCode)); ds = manageSQLConnection.GetDataSetValues("GetCOMMODITYRECEIPT", sqlParameters); // CommodityReceipt commodityReceipt = new CommodityReceipt(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = commodity.GCode, FromDate = commodity.FDate, Todate = commodity.ToDate, UserName = commodity.UserName, // SchemeName = commodity.SchemeName, }; Task.Run(() => commodityReceipt.GenerateCommodityReceiptReport(entity, commodity.ITName, commodity.TRName)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public bool Get(string EMailId) { ManageSQLConnection sqlConnection = new ManageSQLConnection(); ManageUserProfile manageUser = new ManageUserProfile(); DataSet ds = new DataSet(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@username", EMailId)); ds = sqlConnection.GetDataSetValues("GetLoginDetails", sqlParameters); if (manageUser.CheckData(ds)) { MailSending mail = new MailSending(); // CommonEntity commonEntity = new CommonEntity { Subject = "Forgot Password From HMS", BodyMessage = "Hi, <br/> User Password is : " + ds.Tables[0].Rows[0]["userpwd"].ToString(), ToMailid = EMailId, ToCC = "", }; mail.SendForAll(commonEntity); return(true); } //Check Data return(false); }
/// <summary> /// /// </summary> /// <param name="entity"></param> public void GenerateDOOAnnapornaScheme(CommonEntity entity) { string fPath = string.Empty, subF_Path = string.Empty, fileName = string.Empty, filePath = string.Empty; StreamWriter streamWriter = null; try { fileName = entity.GCode + GlobalVariable.DOAnnapornaReportFileName; fPath = GlobalVariable.ReportPath + "Reports"; report.CreateFolderIfnotExists(fPath); // create a new folder if not exists subF_Path = fPath + "//" + entity.UserName; //ManageReport.GetDateForFolder(); report.CreateFolderIfnotExists(subF_Path); //delete file if exists filePath = subF_Path + "//" + fileName + ".txt"; report.DeleteFileIfExists(filePath); streamWriter = new StreamWriter(filePath, true); SocietyWiseDOAllSchemeReport(streamWriter, entity); streamWriter.Flush(); } catch (Exception ex) { AuditLog.WriteError(ex.Message + " " + ex.StackTrace); } finally { streamWriter.Close(); fPath = string.Empty; fileName = string.Empty; streamWriter = null; } }
public string Post([FromBody] ReportParameter reportParameter) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", reportParameter.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", reportParameter.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", reportParameter.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", reportParameter.RCode)); ds = manageSQLConnection.GetDataSetValues("StockReceiptForRegister", sqlParameters); StockReceiptRegister stockDeliveryOrder = new StockReceiptRegister(); ManageReport manageReport = new ManageReport(); if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = reportParameter.GCode, FromDate = reportParameter.FromDate, Todate = reportParameter.ToDate, UserName = reportParameter.UserName }; Task.Run(() => stockDeliveryOrder.GenerateStockReceiptRegister(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public void GenerateIssueMemoReceipt(CommonEntity commonEntity, string GlobalFileName, string reportName, int reportType) { string fPath = string.Empty, subF_Path = string.Empty, fileName = string.Empty, filePath = string.Empty; StreamWriter streamWriter = null; try { fileName = commonEntity.GCode + GlobalFileName; fPath = GlobalVariable.ReportPath + "Reports"; report.CreateFolderIfnotExists(fPath); // create a new folder if not exists subF_Path = fPath + "//" + commonEntity.UserName; //ManageReport.GetDateForFolder(); report.CreateFolderIfnotExists(subF_Path); //delete file if exists filePath = subF_Path + "//" + fileName + ".txt"; report.DeleteFileIfExists(filePath); // isDuplicate = ReceiptId == "0" ? false : true; streamWriter = new StreamWriter(filePath, true); AddDocHeaderForReceipt(streamWriter, commonEntity, reportName); AddDetails(streamWriter, commonEntity.dataSet, reportType); //AddFooter(streamWriter, chequeEntity); } catch (Exception ex) { AuditLog.WriteError(ex.Message + " " + ex.StackTrace); } finally { streamWriter.Flush(); streamWriter.Close(); fPath = string.Empty; fileName = string.Empty; streamWriter = null; } }
public void DisplayLoginPage() { string inputId = null; bool isValid = false; CommonEntity commonEntity = new CommonEntity(); ResourceCulture.SetCurrentCulture("en-US"); Console.WriteLine(ResourceCulture.GetString("LoginTips") + "\n"); while (!isValid) { inputId = Console.ReadLine().Trim(); isValid = commonEntity.IsValidId(inputId); if (!isValid) { Console.WriteLine(ResourceCulture.GetString("LoginInputError") + "\n" + ResourceCulture.GetString("LoginTips")); } } bool isExist = new SecurityEntity().Login(Convert.ToInt32(inputId)); if (!isExist) { Console.WriteLine(ResourceCulture.GetString("LoginNonExistError")); DisplayLoginPage(); } }
public string Post([FromBody] CommodityParameter commodity) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FDate", commodity.FDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", commodity.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@Godcode", commodity.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@ITCode", commodity.TRCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", commodity.RCode)); sqlParameters.Add(new KeyValuePair <string, string>("@IssuedToGodown", Convert.ToString(commodity.IssueToGodown))); sqlParameters.Add(new KeyValuePair <string, string>("@IssuedToDepositor", Convert.ToString(commodity.IssueToDepositor))); ds = manageSQLConnection.GetDataSetValues("GetCommodityIssueMemo", sqlParameters); CommodityIssueMemo commodityIssueMemo = new CommodityIssueMemo(); ManageReport manageReport = new ManageReport(); //filter condotions if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = commodity.GCode, FromDate = commodity.FDate, Todate = commodity.ToDate, UserName = commodity.UserName }; // commodityIssueMemo.GenerateCommodityIssueMemoReport(entity); Task.Run(() => commodityIssueMemo.GenerateCommodityIssueMemoReport(entity)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
public string Post([FromBody] GUGRParameter reportParameter) { DataSet ds = new DataSet(); ManageSQLConnection manageSQLConnection = new ManageSQLConnection(); List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >(); sqlParameters.Add(new KeyValuePair <string, string>("@FromDate", reportParameter.FromDate)); sqlParameters.Add(new KeyValuePair <string, string>("@ToDate", reportParameter.ToDate)); sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", reportParameter.GCode)); sqlParameters.Add(new KeyValuePair <string, string>("@RCode", reportParameter.RCode)); sqlParameters.Add(new KeyValuePair <string, string>("@Type", reportParameter.Type)); ds = manageSQLConnection.GetDataSetValues("GETGRGU", sqlParameters); ManageGUGR manageGUGR = new ManageGUGR(); ManageReport manageReport = new ManageReport(); //filter condotions if (manageReport.CheckDataAvailable(ds)) { CommonEntity entity = new CommonEntity { dataSet = ds, GCode = reportParameter.GCode, FromDate = reportParameter.FromDate, Todate = reportParameter.ToDate, UserName = reportParameter.UserName }; // commodityIssueMemo.GenerateCommodityIssueMemoReport(entity); Task.Run(() => manageGUGR.GenerateGUGRReport(entity, reportParameter)); //Generate the Report } return(JsonConvert.SerializeObject(ds.Tables[0])); }
/// <summary> /// /// </summary> /// <param name="sw"></param> /// <param name="entity"></param> public void DateWiseCommodityIssueMemoReport(StreamWriter sw, CommonEntity entity, DataTable ndt) { try { int count = 8; // var dateList = entity.dataSet.Tables[0].DefaultView.ToTable(true, "Issue_Date"); int pageNo = 1; decimal Payment = 0; decimal Ceral = 0; decimal NonCeral = 0; AddHeader(sw, entity, pageNo); foreach (DataRow row in ndt.Rows) { if (count >= 50) { //Add header again pageNo++; count = 8; sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------"); sw.WriteLine((char)12); AddHeader(sw, entity, pageNo); } sw.Write(" "); sw.Write(report.StringFormatWithoutPipe(row["GodownName"].ToString(), 24, 2)); sw.Write(report.StringFormatWithoutPipe(row["Society"].ToString(), 34, 2)); sw.Write(report.StringFormatWithoutPipe(row["Dono"].ToString(), 10, 2)); sw.Write(report.StringFormatWithoutPipe(row["Dodate"].ToString(), 10, 2) + " "); sw.Write(report.StringFormatWithoutPipe(row["Chequeno"].ToString(), 10, 2)); sw.Write(report.StringFormatWithoutPipe(row["Chequedate"].ToString(), 10, 2)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["PaymentAmount"].ToString()), 12, 1) + " "); sw.Write(report.StringFormatWithoutPipe(row["Bank"].ToString(), 14, 2)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["Cereal"].ToString()), 12, 1)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(row["NonCereal"].ToString()), 12, 1)); sw.WriteLine(""); count = count + 1; Payment += !string.IsNullOrEmpty(row["PaymentAmount"].ToString()) ? Convert.ToDecimal(row["PaymentAmount"]) : 0; Ceral += !string.IsNullOrEmpty(row["Cereal"].ToString()) ? Convert.ToDecimal(row["Cereal"]) : 0; NonCeral += !string.IsNullOrEmpty(row["NonCereal"].ToString()) ? Convert.ToDecimal(row["NonCereal"]) : 0; } sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------"); sw.Write(report.StringFormatWithoutPipe(" ", 25, 2)); sw.Write(report.StringFormatWithoutPipe(" ", 34, 2)); sw.Write(report.StringFormatWithoutPipe(" ", 10, 2)); sw.Write(report.StringFormatWithoutPipe(" ", 10, 2) + " "); sw.Write(report.StringFormatWithoutPipe(" ", 10, 2)); sw.Write(report.StringFormatWithoutPipe("Total", 10, 2)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(Payment)), 12, 1) + " "); sw.Write(report.StringFormatWithoutPipe("", 14, 2)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(Ceral)), 12, 1)); sw.Write(report.StringFormatWithoutPipe(report.Decimalformat(Convert.ToString(NonCeral)), 12, 1)); sw.WriteLine(""); sw.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------"); sw.WriteLine((char)12); } catch (Exception ex) { AuditLog.WriteError(ex.Message + " " + ex.StackTrace); } }
public void IsValidId_invalid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidId("test"); Assert.IsFalse(result); }
public void IsValidGender_invalid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidGender(""); Assert.IsFalse(result); }
public void IsValidBirthday_invalid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidBirthday(""); Assert.IsFalse(result); }
public void IsValidBirthday_valid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidBirthday("2011-1-1"); Assert.IsTrue(result); }
public void IsValidGender_valid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidGender("M"); Assert.IsTrue(result); }
public void IsValidId_valid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidId("111"); Assert.IsTrue(result); }
public void IsValidName_valid() { CommonEntity commonEntity = new CommonEntity(); bool result = commonEntity.IsValidName("test"); Assert.IsTrue(result); }