using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using SysCore.Control;
using SysCore.Model;
using SysCore.DAL;

public partial class Base_RunningNumberRule_RunningNumberRule_Edit : System.Web.UI.Page
{
    public AuthUI auth = new AuthUI();
    public string action;
    public Hashtable xview = new Hashtable();
    protected void Page_Load(object sender, EventArgs e)
    {
        //update为修改状态
        BindData();
    }
    /// <summary>
    /// 绑定页面数据
    /// </summary>
    void BindData()
    {
        string module_code = Request.QueryString["module_code"];
        RunningNumberRuleDAL dal = new RunningNumberRuleDAL();
        RunningNumberRule m = dal.Get(module_code);
        xview.Add("module_code", m.module_code);
        xview.Add("rule1", m.rule1);
        xview.Add("rule2", m.rule2);
        xview.Add("rule3", m.rule3);
        xview.Add("rule1_value", m.rule1_value);
        xview.Add("rule2_value", m.rule2_value);
        xview.Add("rule3_value", m.rule3_value);
        xview.Add("length", m.length);
        RunningNumberPrefixDAL pdal = new RunningNumberPrefixDAL();
        DataTable dt = pdal.GetListByModule(module_code);
        string options = "";
        foreach (DataRow dr in dt.Rows)
        {
            string prefix_code = dr["prefix_code"].ToString();
            string prefix_name = dr["prefix_name"].ToString();
            options += "<option value='" + prefix_code + "'>" + prefix_name + "</option>";
        }
        xview.Add("options", options);
    }
}