public static void UpdateExtraItemDetails(ExtraItemTypeBO argExtraItemContactBO) { SqlConnection conn = new SqlConnection(); SqlCommand cmd; conn = BsfGlobal.OpenCRMDB(); using (SqlTransaction tran = conn.BeginTransaction()) { string sSql = ""; try { sSql = String.Format("UPDATE dbo.ExtraItemMaster SET ExtraItemTypeId={0}, ItemCode='{1}',ItemDescription='{2}',UnitName='{3}', ExtraRate='{4}' " + " WHERE ExtraItemId={5}", ExtraItemTypeBO.ExtraItemTypeId, ExtraItemTypeBO.ItemCode, ExtraItemTypeBO.ItemDescription, ExtraItemTypeBO.UnitName, ExtraItemTypeBO.ExtraRate, ExtraItemTypeBO.ExtraItemId); cmd = new SqlCommand(sSql, conn, tran); cmd.ExecuteNonQuery(); cmd.Dispose(); tran.Commit(); } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } finally { conn.Close(); conn.Dispose(); } } }
public static void InsertExtraItemDetails(ExtraItemTypeBO argExtraItemContactBO) { int iFTypeId = 0; SqlConnection conn = new SqlConnection(); SqlCommand cmd; conn = BsfGlobal.OpenCRMDB(); using (SqlTransaction tran = conn.BeginTransaction()) { try { string sSql = String.Format("INSERT INTO dbo.ExtraItemMaster(ExtraItemTypeId,ItemCode,ItemDescription,UnitName,ExtraRate) VALUES({0}, '{1}', '{2}','{3}','{4}' ) SELECT SCOPE_IDENTITY();", ExtraItemTypeBO.ExtraItemTypeId, ExtraItemTypeBO.ItemCode, ExtraItemTypeBO.ItemDescription, ExtraItemTypeBO.UnitName, ExtraItemTypeBO.ExtraRate); cmd = new SqlCommand(sSql, conn, tran); iFTypeId = int.Parse(cmd.ExecuteScalar().ToString()); cmd.Dispose(); tran.Commit(); } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); tran.Rollback(); } finally { conn.Close(); conn.Dispose(); } } }
public static void UpdateExtraItemDetails(ExtraItemTypeBO argExtraItemContactBO) { ExtraItemTypeDL.UpdateExtraItemDetails(argExtraItemContactBO); }
public static void InsertExtraItemDetails(ExtraItemTypeBO argExtraItemContactBO) { ExtraItemTypeDL.InsertExtraItemDetails(argExtraItemContactBO); }