Ejemplo n.º 1
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] == "1")
            {
                //编辑保存
                zlzw.Model.NavigateListModel navigateListModel = new zlzw.Model.NavigateListModel();
                navigateListModel.NavigateName = txbNavigateName.Text;
                navigateListModel.OrderNumber = int.Parse(txbOrderNumber.Text);
                navigateListModel.IsEnable = 1;
                if (ckbIsShow.Checked)
                {
                    navigateListModel.IsShow = 1;
                }
                else
                {
                    navigateListModel.IsShow = 0;
                }
                navigateListModel.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString());
                navigateListModel.NavigateGUID = new Guid(ViewState["NavigateGUID"].ToString());
                zlzw.BLL.NavigateListBLL navigateListBLL = new zlzw.BLL.NavigateListBLL();
                navigateListModel.NavigateID = int.Parse(Get_ID(navigateListBLL, Request.QueryString["value"]));

                navigateListBLL.Update(navigateListModel);
            }
            else
            {
                //添加保存

                zlzw.Model.NavigateListModel navigateListModel = new zlzw.Model.NavigateListModel();
                navigateListModel.NavigateName = txbNavigateName.Text;
                navigateListModel.OrderNumber = int.Parse(txbOrderNumber.Text);
                navigateListModel.IsEnable = 1;
                if (ckbIsShow.Checked)
                {
                    navigateListModel.IsShow = 1;
                }
                else
                {
                    navigateListModel.IsShow = 0;
                }
                navigateListModel.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                zlzw.BLL.NavigateListBLL navigateListBLL = new zlzw.BLL.NavigateListBLL();
                navigateListBLL.Add(navigateListModel);
            }

            // 2. Close this window and Refresh parent window
            PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public zlzw.Model.NavigateListModel DataRowToModel(DataRow row)
 {
     zlzw.Model.NavigateListModel model = new zlzw.Model.NavigateListModel();
     if (row != null)
     {
         if (row["NavigateID"] != null && row["NavigateID"].ToString() != "")
         {
             model.NavigateID = int.Parse(row["NavigateID"].ToString());
         }
         if (row["NavigateGUID"] != null && row["NavigateGUID"].ToString() != "")
         {
             model.NavigateGUID = new Guid(row["NavigateGUID"].ToString());
         }
         if (row["NavigateName"] != null)
         {
             model.NavigateName = row["NavigateName"].ToString();
         }
         if (row["IsShow"] != null && row["IsShow"].ToString() != "")
         {
             model.IsShow = int.Parse(row["IsShow"].ToString());
         }
         if (row["IsEnable"] != null && row["IsEnable"].ToString() != "")
         {
             model.IsEnable = int.Parse(row["IsEnable"].ToString());
         }
         if (row["OrderNumber"] != null && row["OrderNumber"].ToString() != "")
         {
             model.OrderNumber = int.Parse(row["OrderNumber"].ToString());
         }
         if (row["PublishDate"] != null && row["PublishDate"].ToString() != "")
         {
             model.PublishDate = DateTime.Parse(row["PublishDate"].ToString());
         }
         if (row["Other01"] != null)
         {
             model.Other01 = row["Other01"].ToString();
         }
         if (row["Other02"] != null)
         {
             model.Other02 = row["Other02"].ToString();
         }
     }
     return model;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public zlzw.Model.NavigateListModel GetModel(int NavigateID)
        {
            SqlParameter[] parameters = {
					new SqlParameter("@NavigateID", SqlDbType.Int,4)
			};
            parameters[0].Value = NavigateID;

            zlzw.Model.NavigateListModel model = new zlzw.Model.NavigateListModel();
            DataSet ds = DbHelperSQL.RunProcedure("NavigateList_GetModel", parameters, "ds");
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }