Ejemplo n.º 1
0
 /// <summary>
 /// Gets the init data.
 /// </summary>
 private void GetInitData()
 {
     try
     {
         mctMode = this.mctMgr.GetModel();
     }
     catch (Exception exception)
     {
         LPLog.LogMessage(exception.Message);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the data from UI.
 /// </summary>
 private void GetDataFromUI()
 {
     //get existing record
     GetInitData();
     if (mctMode == null)
     {
         mctMode = new Company_MCT();
     }
     mctMode.ClientID = tbClientID.Text.Trim();
     if (chkEnablePostData.Checked)
     {
         mctMode.PostDataEnabled = true;
     }
     else
     {
         mctMode.PostDataEnabled = false;
     }
     if (mctMode.PostDataEnabled == true)
     {
         mctMode.PostURL = tbMCTPostURL.Text.Trim();
         if (this.ddlActiveLoanInterval.SelectedIndex >= 0)
         {
             mctMode.ActiveLoanInterval = Convert.ToInt32(this.ddlActiveLoanInterval.SelectedValue);
         }
         else
         {
             mctMode.ActiveLoanInterval = 0;
         }
         if (this.ddlArchivedLoanDisposeMonth.SelectedIndex >= 0)
         {
             mctMode.ArchivedLoanDisposeMonth = Convert.ToInt32(this.ddlArchivedLoanDisposeMonth.SelectedValue);
         }
         else
         {
             mctMode.ArchivedLoanDisposeMonth = 0;
         }
         if (this.ddlArchivedLoanInterval.SelectedIndex >= 0)
         {
             mctMode.ArchivedLoanInterval = Convert.ToInt32(this.ddlArchivedLoanInterval.SelectedValue);
         }
         else
         {
             mctMode.ArchivedLoanInterval = 0;
         }
     }
     else
     {
         mctMode.PostURL                  = "";
         mctMode.ActiveLoanInterval       = 0;
         mctMode.ArchivedLoanDisposeMonth = 0;
         mctMode.ArchivedLoanInterval     = 0;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.Company_MCT> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.Company_MCT> modelList = new List <LPWeb.Model.Company_MCT>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.Company_MCT model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Company_MCT();
                    if (dt.Rows[n]["ClientID"] != null && dt.Rows[n]["ClientID"].ToString() != "")
                    {
                        model.ClientID = dt.Rows[n]["ClientID"].ToString();
                    }
                    if (dt.Rows[n]["PostURL"] != null && dt.Rows[n]["PostURL"].ToString() != "")
                    {
                        model.PostURL = dt.Rows[n]["PostURL"].ToString();
                    }
                    if (dt.Rows[n]["PostDataEnabled"] != null && dt.Rows[n]["PostDataEnabled"].ToString() != "")
                    {
                        if ((dt.Rows[n]["PostDataEnabled"].ToString() == "1") || (dt.Rows[n]["PostDataEnabled"].ToString().ToLower() == "true"))
                        {
                            model.PostDataEnabled = true;
                        }
                        else
                        {
                            model.PostDataEnabled = false;
                        }
                    }
                    if (dt.Rows[n]["ActiveLoanInterval"] != null && dt.Rows[n]["ActiveLoanInterval"].ToString() != "")
                    {
                        model.ActiveLoanInterval = int.Parse(dt.Rows[n]["ActiveLoanInterval"].ToString());
                    }
                    if (dt.Rows[n]["ArchivedLoanInterval"] != null && dt.Rows[n]["ArchivedLoanInterval"].ToString() != "")
                    {
                        model.ArchivedLoanInterval = int.Parse(dt.Rows[n]["ArchivedLoanInterval"].ToString());
                    }
                    if (dt.Rows[n]["ArchivedLoanDisposeMonth"] != null && dt.Rows[n]["ArchivedLoanDisposeMonth"].ToString() != "")
                    {
                        model.ArchivedLoanDisposeMonth = int.Parse(dt.Rows[n]["ArchivedLoanDisposeMonth"].ToString());
                    }
                    if (dt.Rows[n]["ArchivedLoanStatuses"] != null && dt.Rows[n]["ArchivedLoanStatuses"].ToString() != "")
                    {
                        model.ArchivedLoanStatuses = dt.Rows[n]["ArchivedLoanStatuses"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LPWeb.Model.Company_MCT model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(LPWeb.Model.Company_MCT model)
 {
     return(dal.Add(model));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Save Data
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Save(LPWeb.Model.Company_MCT model)
 {
     return(dal.Save(model));
 }