public CResult UpdatePrintStyle(CPrintStyle inUser) { CResult oResult = new CResult(); try { this.OpenConnection(); string sSql = String.Format(SqlQueries.GetQuery(Query.UpdatePrintStyle), inUser.Header, inUser.Body, inUser.Footer, inUser.StyleID); 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; }
public RMS.Common.ObjectModel.CResult UpdatePrintStyle(RMS.Common.ObjectModel.CPrintStyle inUser) { CResult oResult = new CResult(); try { this.OpenConnection(); string sSql = String.Format(SqlQueries.GetQuery(Query.UpdatePrintStyle), inUser.Header, inUser.Body, inUser.Footer, inUser.StyleID); 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); }
public RMS.Common.ObjectModel.CResult GetPrintStyle(RMS.Common.ObjectModel.CPrintStyle inCat) { CResult oResult = new CResult(); try { this.OpenConnection(); string sSql = string.Format(SqlQueries.GetQuery(Query.GetPrintStyle), inCat.StyleID); IDataReader oReader = this.ExecuteReader(sSql); if (oReader != null) { if (oReader.Read()) { inCat = ReaderToPrintStyle(oReader); oResult.Data = inCat; oResult.IsSuccess = true; } } } catch (Exception ex) { Logger.Write("Exception : " + ex + " in ItemGetById()", LogLevel.Error, "Database"); oResult.IsException = true; } 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; } }
public CResult UpdatePrintStyle(CPrintStyle inUser) { try { m_oResult = RMS.DataAccess.Database.Instance.PrintStyle.UpdatePrintStyle(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(); } }
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; }