Exemplo n.º 1
0
        private void LoadMembers()
        {
            ContactReward clsContactReward = new ContactReward();
            DataTable dtActiveStatisticsReport = clsContactReward.ActiveStatisticsReport(DateTime.Now.AddMonths(-1), DateTime.Now);
            clsContactReward.CommitAndDispose();

            if (dtActiveStatisticsReport.Rows.Count == 0)
            {
                Chart1.Visible = false;
            }
            else
            {
                Chart1.Visible = true; 
                Chart1.DataSource = dtActiveStatisticsReport.DefaultView;

                Chart1.Series["Series1"].XValueMember = "RewardAwardDate";
                Chart1.Series["Series1"].YValueMembers = "TotalNoOfActiveRewards";

                Chart1.Series["Series2"].XValueMember = "RewardAwardDate";
                Chart1.Series["Series2"].YValueMembers = "NoOfActiveRewards";

                Chart1.Series["Series3"].XValueMember = "RewardAwardDate";
                Chart1.Series["Series3"].YValueMembers = "TotalNoOfInActiveRewards";

                Chart1.Series["Series4"].XValueMember = "RewardAwardDate";
                Chart1.Series["Series4"].YValueMembers = "NoOfInActiveRewards";

                Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineWidth = 0;
                Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineWidth = 0;
                
                Chart1.Series["Series1"].LegendText = "Total No. Of ActiveRewards";
                Chart1.Series["Series2"].LegendText = "No. Of New ActiveRewards";
                Chart1.Series["Series3"].LegendText = "Total No. Of InActiveRewards";
                Chart1.Series["Series4"].LegendText = "No. Of InActiveRewards";

                Chart1.DataBind();
            }
        }
Exemplo n.º 2
0
        private ContactDetails setDetails(System.Data.DataTable dt)
        {
            ContactDetails Details = new ContactDetails();

            try
            {
                foreach(System.Data.DataRow dr in dt.Rows)
                {
                    Details.ContactID = Int64.Parse(dr["ContactID"].ToString());
                    Details.SequenceNo = Int32.Parse(dr["SequenceNo"].ToString());
                    Details.ContactCode = "" + dr["ContactCode"].ToString();
                    Details.ContactName = "" + dr["ContactName"].ToString();
                    Details.ContactGroupID = Int32.Parse(dr["ContactGroupID"].ToString());
                    Details.ContactGroupName = "" + dr["ContactGroupName"].ToString();
                    Details.ModeOfTerms = (ModeOfTerms)Enum.Parse(typeof(ModeOfTerms), dr["ModeOfTerms"].ToString());
                    Details.Terms = Int32.Parse(dr["Terms"].ToString());
                    Details.Address = "" + dr["Address"].ToString();
                    Details.BusinessName = "" + dr["BusinessName"].ToString();
                    Details.TelephoneNo = "" + dr["TelephoneNo"].ToString();
                    Details.Remarks = "" + dr["Remarks"].ToString();
                    Details.Debit = decimal.Parse(dr["Debit"].ToString());
                    Details.Credit =decimal.Parse(dr["Credit"].ToString());
                    Details.CreditLimit = decimal.Parse(dr["CreditLimit"].ToString());
                    Details.IsCreditAllowed = bool.Parse(dr["IsCreditAllowed"].ToString());
                    Details.DateCreated = DateTime.Parse(dr["DateCreated"].ToString());
                    Details.Deleted = bool.Parse(dr["Deleted"].ToString());
                    Details.DepartmentID = Int16.Parse(dr["DepartmentID"].ToString());
                    Details.DepartmentName = "" + dr["DepartmentName"].ToString();
                    Details.PositionID = Int16.Parse(dr["PositionID"].ToString());
                    Details.PositionName = "" + dr["PositionName"].ToString();
                    Details.LastCheckInDate = DateTime.Parse(dr["LastCheckInDate"].ToString());
                    Details.TINNo = "" + dr["TINNo"].ToString();
                    Details.LTONo = "" + dr["LTONo"].ToString();
                    Details.PriceLevel = (PriceLevel)Enum.Parse(typeof(PriceLevel), dr["PriceLevel"].ToString());

                    Details.isLock = bool.Parse(dr["isLock"].ToString());
                }

                // Sep 14, 2011 : Lemu - for reward points
                ContactReward clsContactReward = new ContactReward(base.Connection, base.Transaction);
                Details.RewardDetails = clsContactReward.Details(Details.ContactID);

                // Nov 2, 2011 : Lemu - for credit
                ContactCreditCardInfos clsContactCredit = new ContactCreditCardInfos(base.Connection, base.Transaction);
                Details.CreditDetails = clsContactCredit.Details(Details.ContactID);
                Details.CreditDetails.CreditLimit = Details.CreditLimit;

                if (!Details.IsCreditAllowed)
                    Details.CreditDetails.CreditActive = Details.IsCreditAllowed;
                else
                {
                    Details.CreditDetails.CreditActive = checkCreditActive(Details.CreditDetails.CreditCardStatus);
                }

                // Oct 12, 2013 : - get additional details
                Details.AdditionalDetails = new ContactAddOns(base.Connection, base.Transaction).Details(Details.ContactID);
            }
            catch (Exception ex) { throw base.ThrowException(ex); }
            return Details;
        }
Exemplo n.º 3
0
		private void SetDataSource(ReportDocument Report)
		{
			ReportDataset rptds = new ReportDataset();
            System.Data.DataTable dt;

            DateTime StartTransactionDate = DateTime.MinValue;
            try
            { StartTransactionDate = Convert.ToDateTime(txtStartTransactionDate.Text); }
            catch { }
            DateTime EndTransactionDate = DateTime.MinValue;
            try
            { EndTransactionDate = Convert.ToDateTime(txtEndTransactionDate.Text); }
            catch { }

            ContactReward clsContactReward;
            switch (cboReportType.SelectedValue)
            {
                case ReportTypes.RewardsHistory:
                    #region RewardsHistory
                    clsContactReward = new ContactReward();
                    dt = clsContactReward.RewardsMovement(StartTransactionDate, EndTransactionDate, long.Parse(cboContactName.SelectedItem.Value));
                    clsContactReward.CommitAndDispose();

                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow drNew = rptds.RewardsMovement.NewRow();

                        foreach (DataColumn dc in rptds.RewardsMovement.Columns)
                            drNew[dc] = dr[dc.ColumnName];

                        rptds.RewardsMovement.Rows.Add(drNew);
                    }

                    break;
                    #endregion

                case ReportTypes.RewardsSummary:
                    #region RewardsSummary
                    clsContactReward = new ContactReward();
                    dt = clsContactReward.RewardsSummary(StartTransactionDate, EndTransactionDate, long.Parse(cboContactName.SelectedItem.Value));
                    clsContactReward.CommitAndDispose();

                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow drNew = rptds.Rewards.NewRow();

                        foreach (DataColumn dc in rptds.Rewards.Columns)
                            drNew[dc] = dr[dc.ColumnName];

                        rptds.Rewards.Rows.Add(drNew);
                    }

                    break;
                    #endregion

                case ReportTypes.RewardsSummaryStatistics:
                    #region RewardsSummaryStatistics
                    clsContactReward = new ContactReward();
                    dt = clsContactReward.SummarizedStatistics();
                    clsContactReward.CommitAndDispose();

                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow drNew = rptds.RewardsSummary.NewRow();

                        foreach (DataColumn dc in rptds.RewardsSummary.Columns)
                            drNew[dc] = dr[dc.ColumnName];

                        rptds.RewardsSummary.Rows.Add(drNew);
                    }

                    break;
                    #endregion
                
            }
			Report.SetDataSource(rptds); 
			SetParameters(Report);
		}