private CPrintStyle ReaderToPrintStyle(IDataReader oReader) { CPrintStyle oItem = new CPrintStyle(); if (oReader["style_id"] != null) { oItem.StyleID = Int32.Parse(oReader["style_id"].ToString()); } if (oReader["header"] != null) { oItem.Header = oReader["header"].ToString(); } if (oReader["body"] != null) { oItem.Body = oReader["body"].ToString(); } if (oReader["footer"] != null) { oItem.Footer = oReader["footer"].ToString(); } //if (oReader["style_name"] != null) // oItem. = oReader["style_name"].ToString(); return(oItem); }
public CResult GetPrintStyle(CPrintStyle inUser) { try { m_oResult = RMS.DataAccess.Database.Instance.PrintStyle.GetPrintStyle(inUser); } catch (Exception ex) { System.Console.WriteLine("Exception occuer at DeleteItem() : " + ex.Message); m_oResult.IsException = true; m_oResult.Action = EERRORNAME.EXCEPTION_OCCURE; m_oResult.SetParams(ex.Message); m_oResult.Message = ex.Message; Logger.Write("Exception : " + ex + " in DeleteItem()", LogLevel.Error, "CItemManager"); } return(m_oResult); }
private void UpdateReceiptStyle_Load(object sender, EventArgs e) { CPrintStyle oPrint = new CPrintStyle(); CCommonConstants oConstant = ConfigManager.GetConfig <CCommonConstants>(); oPrint.StyleID = m_styleID; CUserManager oManager = new CUserManager(); CResult oResult = oManager.GetPrintStyle(oPrint); if (oResult.IsSuccess && oResult.Data != null) { oPrint = (CPrintStyle)oResult.Data; txtHeader.Text = oPrint.Header.Trim(); txtMessage.Text = oPrint.Body.Trim(); txtFooter.Text = oPrint.Footer.Trim(); } }
public CResult AddPrintStyle(CPrintStyle inUser) { CResult oResult = new CResult(); try { inUser.Header = inUser.Header.Replace("''", "'"); inUser.Header = inUser.Header.Replace("'", "''"); inUser.Body = inUser.Body.Replace("''", "'"); inUser.Body = inUser.Body.Replace("'", "''"); inUser.Footer = inUser.Footer.Replace("''", "'"); inUser.Footer = inUser.Footer.Replace("'", "''"); this.OpenConnection(); string sSql = String.Format(SqlQueries.GetQuery(Query.AddPrintStyle), inUser.Header, inUser.Body, inUser.Footer); this.ExecuteNonQuery(sSql); oResult.IsSuccess = true; } catch (Exception ex) { Logger.Write("Exception : " + ex + " in ItemInsert() in CUserInfoDAO class", LogLevel.Error, "Database"); oResult.IsException = true; //throw new Exception("Exception occure at ItemInsert()", ex); } finally { this.CloseConnection(); } return(oResult); }
private void btnSave_Click(object sender, EventArgs e) { String sTempHeader = txtHeader.Text.Trim(); String sTempBody = txtMessage.Text.Trim(); String sTempFooter = txtFooter.Text.Trim(); CPrintStyle oPrint = new CPrintStyle(); oPrint.Header = sTempHeader; oPrint.Body = sTempBody; oPrint.Footer = sTempFooter; CCommonConstants oConstant = ConfigManager.GetConfig <CCommonConstants>(); oPrint.StyleID = m_styleID;// oConstant.PrintStyleID; CUserManager oManager = new CUserManager(); CResult oResult = oManager.UpdatePrintStyle(oPrint); if (oResult.IsSuccess) { lblSaveStatus.Text = " Receipt style is updated successfully."; lblSaveStatus.Visible = true; } else { lblSaveStatus.Text = " Could not update receipt style. Please try again."; lblSaveStatus.Visible = true; } }