Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.LoanMarketingEvents> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.LoanMarketingEvents> modelList = new List <LPWeb.Model.LoanMarketingEvents>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.LoanMarketingEvents model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.LoanMarketingEvents();
                    if (dt.Rows[n]["LoanMarketingEventId"].ToString() != "")
                    {
                        model.LoanMarketingEventId = int.Parse(dt.Rows[n]["LoanMarketingEventId"].ToString());
                    }
                    model.Action = dt.Rows[n]["Action"].ToString();
                    if (dt.Rows[n]["ExecutionDate"].ToString() != "")
                    {
                        model.ExecutionDate = DateTime.Parse(dt.Rows[n]["ExecutionDate"].ToString());
                    }
                    if (dt.Rows[n]["LoanMarketingId"].ToString() != "")
                    {
                        model.LoanMarketingId = int.Parse(dt.Rows[n]["LoanMarketingId"].ToString());
                    }
                    model.LeadStarEventId = dt.Rows[n]["LeadStarEventId"].ToString();
                    if (dt.Rows[n]["Completed"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Completed"].ToString() == "1") || (dt.Rows[n]["Completed"].ToString().ToLower() == "true"))
                        {
                            model.Completed = true;
                        }
                        else
                        {
                            model.Completed = false;
                        }
                    }
                    if (dt.Rows[n]["WeekNo"].ToString() != "")
                    {
                        model.WeekNo = int.Parse(dt.Rows[n]["WeekNo"].ToString());
                    }
                    model.EventContent = dt.Rows[n]["EventContent"].ToString();
                    model.EventURL     = dt.Rows[n]["EventURL"].ToString();
                    if (dt.Rows[n]["FileId"].ToString() != "")
                    {
                        model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
    protected void chkCompleted_Click(object sender, EventArgs e)
    {
        CheckBox chk = (CheckBox)sender;

        if (!string.IsNullOrEmpty(chk.ToolTip))
        {
            int eventId = Convert.ToInt32(chk.ToolTip);

            LPWeb.BLL.LoanMarketingEvents bll = new LoanMarketingEvents();

            LPWeb.Model.LoanMarketingEvents modalLME = bll.GetModel(eventId);

            modalLME.Completed = chk.Checked;

            bll.Update(modalLME);

            //later  : send a CompleteCampaignEventRequest to Marketing Manager
        }

        //PageCommon.WriteJsEnd(this, chk.ToolTip, PageCommon.Js_RefreshSelf);
        BindGrid();
    }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.LoanMarketingEvents model)
 {
     dal.Update(model);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.LoanMarketingEvents model)
 {
     return(dal.Add(model));
 }