Example #1
0
        internal static DataTable SelectIncGenTrans(IncentiveBO IncGenBO)
        {
            BsfGlobal.OpenCRMDB();
            string         ssql     = "";
            DataTable      dt_Trans = null;
            SqlDataAdapter sda;

            try
            {
                ssql     = string.Format("Select * From dbo.IncentiveRegTrans Where IncentiveId={0}", IncGenBO.i_IncGenId);
                sda      = new SqlDataAdapter(ssql, BsfGlobal.g_CRMDB);
                dt_Trans = new DataTable();
                sda.Fill(dt_Trans);
                dt_Trans.Dispose();
            }
            catch (Exception e)
            {
                BsfGlobal.CustomException(e.Message, e.StackTrace);
            }
            finally
            {
                BsfGlobal.g_CRMDB.Close();
            }
            return(dt_Trans);
        }
Example #2
0
        internal static int InsertIncGen(string argMode, IncentiveBO IncGenBO)
        {
            BsfGlobal.OpenCRMDB();
            string     ssql = "";
            SqlCommand scmd;
            string     s_Date     = "";
            string     s_From     = "";
            string     s_To       = "";
            int        i_IncGenId = 0;

            try
            {
                s_Date = string.Format("{0:dd/MMM/yyyy}", IncGenBO.DE_Date);
                s_From = string.Format("{0:dd/MMM/yyyy}", IncGenBO.DE_From);
                s_To   = string.Format("{0:dd/MMM/yyyy}", IncGenBO.DE_To);

                if (argMode == "A")
                {
                    ssql                = String.Format("Insert Into dbo.IncentiveRegister(IDate, IRefNo, FDate, TDate, TotalAmount, Narration) Values('{0}', '{1}', '{2}', '{3}', {4}, '{5}') SELECT SCOPE_IDENTITY();", s_Date, IncGenBO.s_RefNo, s_From, s_To, IncGenBO.d_TotalAmount, IncGenBO.s_Narration);
                    scmd                = new SqlCommand(ssql, BsfGlobal.g_CRMDB);
                    i_IncGenId          = Convert.ToInt32(scmd.ExecuteScalar().ToString());
                    IncGenBO.i_IncGenId = i_IncGenId;
                    scmd.Dispose();
                }
                else
                {
                    ssql = String.Format("Update dbo.IncentiveRegister set IDate='{0}', IRefNo='{1}', FDate='{2}', TDate='{3}', TotalAmount={4}, Narration='{5}' Where IncentiveId={6}", s_Date, IncGenBO.s_RefNo, s_From, s_To, IncGenBO.d_TotalAmount, IncGenBO.s_Narration, IncGenBO.i_IncGenId);
                    scmd = new SqlCommand(ssql, BsfGlobal.g_CRMDB);
                    scmd.ExecuteNonQuery();
                    scmd.Dispose();
                }
            }
            catch (Exception e)
            {
                BsfGlobal.CustomException(e.Message, e.StackTrace);
            }
            finally
            {
                BsfGlobal.g_CRMDB.Close();
            }
            return(i_IncGenId);
        }
Example #3
0
 public static DataTable SelectIncGenTrans(IncentiveBO IncGenBO)
 {
     return(IncentiveDL.SelectIncGenTrans(IncGenBO));
 }
Example #4
0
 public static void InsertAmount(string argMode, IncentiveBO IncGenBO)
 {
     IncentiveDL.InsertAmount(argMode, IncGenBO);
 }
Example #5
0
 public static int InsertIncGen(string argMode, IncentiveBO IncGenBO)
 {
     return(IncentiveDL.InsertIncGen(argMode, IncGenBO));
 }