/// <summary>
    /// 添加
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Save_Click(object sender, ImageClickEventArgs e)
    {
        int num = 0;

        if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);
            mod = ProductParamBLL.GetmodByid(id);
            mod.ParamContent = txtparamContent.Text.Trim();
            num = ProductParamBLL.Updatemod(mod);
        }
        else
        {
            mod = new ProductParamMOD();
            mod.CustomNo = txtcustomerNo.Text.Trim();
            mod.ParamContent = txtparamContent.Text.Trim();
            mod.ProductNo = txtproductNO.Text.Trim();
            num = ProductParamBLL.Insertmod(mod);
        }
        if (num > 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "DetailsPageControl.CloseBox();alert('提交成功');DetailsPageControl.ReflushList('CustomerManage/ProductParamManage.aspx');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('提交失败');", true);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
         {
             int id = Convert.ToInt32(Request.QueryString["id"]);
             mod = ProductParamBLL.GetmodByid(id);
             if (mod != null)
             {
                 //加载客户信息
                 txtcustomerNo.Text = mod.CustomNo;
                 txtparamContent.Text = mod.ParamContent;
                 txtproductNO.Text = mod.ProductNo;
             }
             //客户编号不允许修改
             txtcustomerNo.Enabled = false;
             txtproductNO.Enabled = false;
         }
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 根据主键id查询信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static ProductParamMOD GetmodByid(int id)
        {
            ProductParamMOD mod = new ProductParamMOD();
            string sqlcommandString = "select * from ProductParam where paramId=" + id;

            try
            {
                SqlDataReader reader = SqlHelper.ExecuteReader(sqlcommandString);
                if (reader.Read())
                {
                    mod.ProductNo = reader["ProductNo"].ToString();
                    mod.CustomNo = reader["CustomNo"].ToString();
                    mod.ParamId = Convert.ToInt32(reader["ParamId"].ToString());
                    mod.ParamContent = reader["ParamContent"].ToString();
                    if (reader["IsWriteFahuoInfo"] != null && reader["IsWriteFahuoInfo"].ToString() != "")
                    {
                        mod.IsWriteFahuoInfo = Convert.ToInt32(reader["IsWriteFahuoInfo"]);
                    }
                    if (reader["IsWriteXianChang"] != null && reader["IsWriteXianChang"].ToString() != "")
                    {
                        mod.IsWriteXianChang = Convert.ToInt32(reader["IsWriteXianChang"]);
                    }
                    mod.Wuliaobian = reader["wuliaobian"].ToString();
                    reader.Close();
                    return mod;
                }
                else
                {
                    reader.Close();
                    return null;
                }

            }
            catch (Exception e)
            {
                throw e;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);
                mod = ProductParamBLL.GetmodByid(id);
                if (mod != null)
                {
                    //加载客户信息
                    txtcustomerNo.Text = mod.CustomNo;
                    txtparamContent.Text = mod.ParamContent;
                    txtproductNO.Text = mod.ProductNo;
                    txtWuliaobian.Text = mod.Wuliaobian;
                    if (mod.IsWriteFahuoInfo != null && mod.IsWriteFahuoInfo.ToString() != "")
                    {
                        switch (mod.IsWriteFahuoInfo)
                        {
                            case 0:
                                rdoCusYes.Checked = false;
                                rdoCusNo.Checked = true;
                                break;
                            case 1:

                                rdoCusYes.Checked = true;
                                rdoCusNo.Checked = false;
                                break;
                            default:
                                rdoCusYes.Checked = false;
                                rdoCusNo.Checked = false;
                                break;
                        }
                    }
                    else
                    {
                        rdoCusYes.Checked = false;
                        rdoCusNo.Checked = false;
                    }
                    if (mod.IsWriteXianChang != null && mod.IsWriteXianChang.ToString() != "")
                    {
                        switch (mod.IsWriteXianChang)
                        {
                            case 0:
                                rdoProYes.Checked = false;
                                rdoProNo.Checked = true;

                                break;
                            case 1:
                                rdoProYes.Checked = true;
                                rdoProNo.Checked = false;
                                break;
                            default:
                                rdoProYes.Checked = false;
                                rdoProNo.Checked = false;
                                break;
                        }
                    }
                    else
                    {
                        rdoProYes.Checked = false;
                        rdoProNo.Checked = false;
                    }
                }
                //客户编号不允许修改
                txtcustomerNo.Enabled = false;
                txtproductNO.Enabled = false;
            }
        }
    }
    /// <summary>
    /// 添加
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Save_Click(object sender, ImageClickEventArgs e)
    {
        int num = 0;

        if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);
            mod = ProductParamBLL.GetmodByid(id);
            mod.ParamContent = txtparamContent.Text.Trim();
            if (rdoCusYes.Checked)
            {
                mod.IsWriteFahuoInfo = 1;
            }
            else
            {
                mod.IsWriteFahuoInfo = 0;
            }
            if (rdoProYes.Checked)
            {
                mod.IsWriteXianChang = 1;
            }
            else
            {
                mod.IsWriteXianChang = 0;
            }
            mod.Wuliaobian = txtWuliaobian.Text.Trim();
            num = ProductParamBLL.Updatemod(mod);
        }
        else
        {
            mod = ProductParamBLL.GetmodByid(txtcustomerNo.Text.Trim(), txtproductNO.Text.Trim());
            if (mod != null)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('该客户的产品参数已存在!');", true);
                return;
            }
            else
            {
                mod = new ProductParamMOD();
                mod.CustomNo = txtcustomerNo.Text.Trim();
                mod.ParamContent = txtparamContent.Text.Trim();
                mod.ProductNo = txtproductNO.Text.Trim();
                mod.Wuliaobian = txtWuliaobian.Text.Trim();
                if (rdoCusYes.Checked)
                {
                    mod.IsWriteFahuoInfo = 1;
                }
                else
                {
                    mod.IsWriteFahuoInfo = 0;
                }
                if (rdoProYes.Checked)
                {
                    mod.IsWriteXianChang = 1;
                }
                else
                {
                    mod.IsWriteXianChang = 0;
                }
                num = ProductParamBLL.Insertmod(mod);
            }
        }
        if (num > 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "DetailsPageControl.CloseBox();alert('提交成功');DetailsPageControl.ReflushList('CustomerManage/ProductParamManage.aspx');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('提交失败');", true);
        }
    }
Esempio n. 6
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="dtomodList">数据对象</param>
 /// <returns></returns>
 public static int Updatemod(ProductParamMOD mod)
 {
     return ProductParamDAO.Updatemod(mod);
 }
Esempio n. 7
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="dtomodList">对象</param>
 /// <returns></returns>
 public static int Insertmod(ProductParamMOD mod)
 {
     return ProductParamDAO.Insertmod(mod);
 }
Esempio n. 8
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="dtomodList">数据对象</param>
 /// <returns></returns>
 public static int Updatemod(ProductParamMOD mod)
 {
     string sqlCommandString = "Update ProductParam Set paramContent=@paramContent,isWriteFahuoInfo=@isWriteFahuoInfo,isWriteXianChang=@isWriteXianChang,wuliaobian=@wuliaobian Where paramId=@paramId";
     SqlParameter[] arParams = new SqlParameter[5];
     arParams[0] = new SqlParameter("@paramId", mod.ParamId);
     arParams[1] = new SqlParameter("@paramContent", mod.ParamContent);
     arParams[2] = new SqlParameter("@isWriteFahuoInfo", mod.IsWriteFahuoInfo);
     arParams[3] = new SqlParameter("@isWriteXianChang", mod.IsWriteXianChang);
     arParams[4] = new SqlParameter("@wuliaobian", mod.Wuliaobian);
     return SqlHelper.ExecuteNonQuery(CommandType.Text, sqlCommandString, arParams);
 }
Esempio n. 9
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="dtomodList">对象</param>
 /// <returns></returns>
 public static int Insertmod(ProductParamMOD mod)
 {
     string sqlCommandString = "Insert Into ProductParam(customNo,productNo,paramContent,isWriteFahuoInfo,isWriteXianChang,wuliaobian)Values(@customNo,@productNo,@paramContent,@isWriteFahuoInfo,@isWriteXianChang,@wuliaobian)";
     SqlParameter[] arParams = new SqlParameter[6];
     arParams[0] = new SqlParameter("@customNo", mod.CustomNo);
     arParams[1] = new SqlParameter("@productNo", mod.ProductNo);
     arParams[2] = new SqlParameter("@paramContent", mod.ParamContent);
     arParams[3] = new SqlParameter("@isWriteFahuoInfo", mod.IsWriteFahuoInfo);
     arParams[4] = new SqlParameter("@isWriteXianChang", mod.IsWriteXianChang);
     arParams[5] = new SqlParameter("@wuliaobian",mod.Wuliaobian);
     return SqlHelper.ExecuteNonQuery(CommandType.Text, sqlCommandString, arParams);
 }