示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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();
            }
        }
示例#5
0
        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();
            }
        }
示例#6
0
        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();
            }
        }
示例#7
0
 public static void UpdateBlock(StageDetBO BOstageDet, int argBlockId)
 {
     StageDetDL.UpdateBlock(BOstageDet, argBlockId);
 }
示例#8
0
 public static int InsertStage(StageDetBO BOstageDet)
 {
     return(StageDetDL.InsertStage(BOstageDet));
 }
示例#9
0
 public static int InsertBlock(StageDetBO BOstageDet)
 {
     return(StageDetDL.InsertBlock(BOstageDet));
 }
示例#10
0
 internal static bool CheckBlockFound(StageDetBO BOstageDet)
 {
     return(StageDetDL.CheckBlockFound(BOstageDet));
 }
示例#11
0
 public static void DeleteLevelBlock(StageDetBO BOstageDet)
 {
     StageDetDL.DeleteLevelBlock(BOstageDet);
 }
示例#12
0
 public static void InsertLevelBlock(StageDetBO BOstageDet)
 {
     StageDetDL.InsertLevelBlock(BOstageDet);
 }
示例#13
0
 public static void UpdateLevel(StageDetBO BOstageDet, int argLevelId)
 {
     StageDetDL.UpdateLevel(BOstageDet, argLevelId);
 }
示例#14
0
 public static int InsertLevel(StageDetBO BOstageDet)
 {
     return(StageDetDL.InsertLevel(BOstageDet));
 }
示例#15
0
 internal static void UpdateStage(StageDetBO BOstageDet, int argStageId)
 {
     StageDetDL.UpdateStage(BOstageDet, argStageId);
 }