internal static int InsertLevel(StageDetBO BOstageDet) { string sSql = ""; int iId = 0; BsfGlobal.OpenCRMDB(); SqlCommand cmd = null; try { sSql = string.Format("Insert into LevelMaster(LevelName, CostCentreId, SortOrder)" + " Values('{0}', {1}, {2}) SELECT SCOPE_IDENTITY();", BOstageDet.s_LevelName, BOstageDet.i_CostCentreId, BOstageDet.i_SortOrderLevel); cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); iId = int.Parse(cmd.ExecuteScalar().ToString()); cmd.Dispose(); sSql = " Update ProjectInfo Set NoOfFloors=(Select Count(LevelId) NoOfFloor From LevelMaster " + " Where CostCentreId=" + BOstageDet.i_CostCentreId + ") Where CostCentreId=" + BOstageDet.i_CostCentreId + ""; cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); cmd.ExecuteNonQuery(); cmd.Dispose(); } catch (Exception e) { BsfGlobal.CustomException(e.Message, e.StackTrace); } finally { BsfGlobal.g_CRMDB.Close(); } return(iId); }
internal static int InsertStage(StageDetBO BOstageDet) { string sSql = ""; int iId = 0; BsfGlobal.OpenCRMDB(); SqlCommand cmd = null; try { sSql = string.Format("Insert into Stages(StageName, CostCentreId, SortOrder)" + " Values('{0}', {1}, {2}) SELECT SCOPE_IDENTITY();", BOstageDet.s_StageName, BOstageDet.i_CostCentreId, BOstageDet.i_SorOrderStage); cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); iId = int.Parse(cmd.ExecuteScalar().ToString()); cmd.Dispose(); } catch (Exception e) { BsfGlobal.CustomException(e.Message, e.StackTrace); } finally { BsfGlobal.g_CRMDB.Close(); } return(iId); }
internal static bool CheckBlockFound(StageDetBO BOstageDet) { string sSql = ""; bool bAns = false; BsfGlobal.OpenCRMDB(); SqlCommand cmd = null; SqlDataReader dr; try { sSql = "Select BlockName From BlockMaster Where BlockName='" + BOstageDet.s_BlockName + "' And CostCentreId=" + BOstageDet.i_CostCentreId + ""; cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); if (dt.Rows.Count > 0) { bAns = true; } cmd.Dispose(); } catch (Exception e) { BsfGlobal.CustomException(e.Message, e.StackTrace); } finally { BsfGlobal.g_CRMDB.Close(); } return(bAns); }
internal static void UpdateStage(StageDetBO BOstageDet, int argStageId) { string sSql = ""; BsfGlobal.OpenCRMDB(); SqlCommand cmd = null; try { sSql = "Update Stages Set StageName='" + BOstageDet.s_StageName + "',SortOrder=" + BOstageDet.i_SorOrderStage + " Where CostCentreId=" + BOstageDet.i_CostCentreId + "" + " And StageId=" + argStageId + ""; cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); cmd.ExecuteNonQuery(); } catch (Exception e) { BsfGlobal.CustomException(e.Message, e.StackTrace); } finally { BsfGlobal.g_CRMDB.Close(); } }
internal static void DeleteLevelBlock(StageDetBO BOstageDet) { string sSql = ""; BsfGlobal.OpenCRMDB(); SqlCommand cmd = null; try { sSql = string.Format("Delete BlockLevelTrans Where BlockId={0} AND LevelId={1}", BOstageDet.i_BlockId, BOstageDet.i_LevelBlockId); cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); cmd.ExecuteNonQuery(); cmd.Dispose(); } catch (Exception e) { BsfGlobal.CustomException(e.Message, e.StackTrace); } finally { BsfGlobal.g_CRMDB.Close(); } }
internal static void InsertLevelBlock(StageDetBO BOstageDet) { string sSql = ""; BsfGlobal.OpenCRMDB(); SqlCommand cmd = null; try { sSql = string.Format("Insert into BlockLevelTrans(LevelId, BlockId)" + " Values({0}, {1})", BOstageDet.i_LevelBlockId, BOstageDet.i_BlockId); cmd = new SqlCommand(sSql, BsfGlobal.g_CRMDB); cmd.ExecuteNonQuery(); cmd.Dispose(); } catch (Exception e) { BsfGlobal.CustomException(e.Message, e.StackTrace); } finally { BsfGlobal.g_CRMDB.Close(); } }
public static void UpdateBlock(StageDetBO BOstageDet, int argBlockId) { StageDetDL.UpdateBlock(BOstageDet, argBlockId); }
public static int InsertStage(StageDetBO BOstageDet) { return(StageDetDL.InsertStage(BOstageDet)); }
public static int InsertBlock(StageDetBO BOstageDet) { return(StageDetDL.InsertBlock(BOstageDet)); }
internal static bool CheckBlockFound(StageDetBO BOstageDet) { return(StageDetDL.CheckBlockFound(BOstageDet)); }
public static void DeleteLevelBlock(StageDetBO BOstageDet) { StageDetDL.DeleteLevelBlock(BOstageDet); }
public static void InsertLevelBlock(StageDetBO BOstageDet) { StageDetDL.InsertLevelBlock(BOstageDet); }
public static void UpdateLevel(StageDetBO BOstageDet, int argLevelId) { StageDetDL.UpdateLevel(BOstageDet, argLevelId); }
public static int InsertLevel(StageDetBO BOstageDet) { return(StageDetDL.InsertLevel(BOstageDet)); }
internal static void UpdateStage(StageDetBO BOstageDet, int argStageId) { StageDetDL.UpdateStage(BOstageDet, argStageId); }