Exemplo n.º 1
0
    // private YuyueLimit yuyueLimit;

    private void ReBind()
    {
        YuyueLimit entity = YuyueLimitOperator.Get(Convert.ToInt32(this.hidPaiBanId.Value));
        string     sql    = "select id,c_lsh,c_idcard,c_xm,date_pxshrq,c_hmhp,c_jbr,decode(i_checked,0,'未审核',1,'已审核',2,'审核不过') i_checked,c_check_result from table_yuyue_info"
                            + "  where (i_checked<>2 or i_checked is null) and i_paibanid=" + entity.Id;

        dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmp");
        if (dt != null)
        {
            this.trueNum = dt.Rows.Count;
        }
        else
        {
            dt           = MockDataTable();
            this.trueNum = 0;
        }
        int num = entity.Total + entity.TpTotal - trueNum;

        for (int i = 0; i < num; i++)
        {
            dt.Rows.Add(dt.NewRow());
        }
        this.DataGrid1.DataSource = dt;
        this.DataGrid1.DataBind();

        sql = "select id,c_lsh,c_idcard,c_xm,date_pxshrq,c_hmhp,c_jbr,decode(i_checked,0,'未审核',1,'已审核',2,'审核不过') i_checked,c_check_result from table_yuyue_info"
              + "  where i_checked=2 and i_paibanid=" + entity.Id;
        dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmp");
        if (dt != null)
        {
            this.DataGrid2.DataSource = dt;
            this.DataGrid2.DataBind();
        }
    }
Exemplo n.º 2
0
 private void InitYuyueLimit(YuyueLimit entity)
 {
     this.cbKscc.SelectedValue = entity.KsccCode;
     this.cbKsdd.SelectedValue = entity.KsddCode;
     this.lbYkrq.Text          = entity.Ksrq;
     this.cbKm.SelectedValue   = entity.Km.ToString();
     this.hidPaiBanId.Value    = entity.Id.ToString();
     this.lbSchoolName.Text    = "非培训队报考人员";
 }
Exemplo n.º 3
0
    public static void Create(WeekRecord week, ArrayList limits)
    {
        SimpleOrmOperator.Create(week);
        string   datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        DateTime begin   = DateTimeHelper.GetMonday(DateTime.Parse(datestr));

        foreach (object obj in limits)
        {
            YuyueLimit limit = obj as YuyueLimit;
            YuyueLimitOperator.Save(week, limit, begin);
        }
    }
Exemplo n.º 4
0
    protected void ImageButton_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton btn    = sender as ImageButton;
        TableRow    row    = btn.Parent.Parent as TableRow;
        TableCell   cell   = btn.Parent as TableCell;
        int         i      = int.Parse(cell.ToolTip);
        int         rownum = int.Parse(cell.CssClass);

        if (btn.ToolTip == "重新分配")
        {
            // row.
            row.Cells[i + 2].Text = "";
            ArrayList limits       = ViewState[VIEWSTATUE_LIMITS] as ArrayList;
            ArrayList removeLimits = new ArrayList();
            foreach (object obj in limits)
            {
                YuyueLimit limit      = obj as YuyueLimit;
                int        km         = (i + 2) / 2;
                int        datyOfWeek = rownum - 1;
                if (limit.DayOfWeek == datyOfWeek && limit.Km == km)
                {
                    removeLimits.Add(obj);
                }
            }
            foreach (object obj in removeLimits)
            {
                limits.Remove(obj);
            }
            ViewState[VIEWSTATUE_LIMITS] = limits;
            //row.Cells[i + 2].Controls.Clear();
            //string s = "";
        }
        if (btn.ToolTip == "添加分配")
        {
            //int count=row.Cells[i + 2].Controls.Count;
            if (this.hidRowOld.Value != "-1" && this.hidColOld.Value != "-1")
            {
                int j = int.Parse(this.hidColOld.Value);
                int m = int.Parse(this.hidRowOld.Value);
                this.Table1.Rows[m].Cells[j + 2].BackColor = System.Drawing.Color.White;
            }
            this.hidColNew.Value = i.ToString();
            this.hidRowNew.Value = rownum.ToString();
            this.hidColOld.Value = i.ToString();
            this.hidRowOld.Value = rownum.ToString();
            if (this.hidColNew.Value != "-1")
            {
                int k = int.Parse(this.hidColNew.Value);
                row.Cells[k + 2].BackColor = System.Drawing.Color.Red;
            }
        }
    }
Exemplo n.º 5
0
    private static String genLimitKey(YuyueLimit limit)
    {
        String key = "";

        key = string.Format("{0}::{1}::{2}::{3}::{4}::{5}",
                            limit.WeekNum
                            , limit.DayOfWeek
                            , limit.Km
                            , limit.KsccCode
                            , limit.KsddCode
                            , limit.SchoolCode
                            );
        return(key);
    }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DictOperator.BindDropDownList("考试地点", this.cbKsdd);
         DictOperator.BindDropDownList("考试场次", this.cbKscc);
         // SchoolCarInfoOperator.Bind(this.cbCarNo, this.Operator.Desp3);
         if (Request.Params["id"] != null)
         {
             YuyueLimit entity = YuyueLimitOperator.Get(Convert.ToInt32(Request.Params["id"]));
             //this.yuyueLimit = entity;
             this.InitYuyueLimit(entity);
         }
     }
 }
Exemplo n.º 7
0
    public static void Update(WeekRecord week, ArrayList limits)
    {
        SimpleOrmOperator.Update(week);
        string   datestr   = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        DateTime begin     = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
        string   deleteSql = "delete from table_yuyue_limit where i_week_num=" + week.WeekNum + " and date_ksrq like '" + begin.Year.ToString() + "%'";

        DataAccessFactory.GetDataAccess().ExecuteSql(deleteSql);

        foreach (object obj in limits)
        {
            YuyueLimit limit = obj as YuyueLimit;
            YuyueLimitOperator.Save(week, limit, begin);
        }
    }
Exemplo n.º 8
0
    public static void Save(WeekRecord week, int dayofweek, int km, string begindate, string desc)
    {
        if (desc == null || desc.Length == 0)
        {
            return;
        }
        int       weeknum = week.WeekNum;
        DateTime  begin   = DateTime.Parse(begindate);
        ArrayList lists   = new ArrayList();

        string[]   array1 = desc.Trim("<br/>".ToCharArray()).Split(new string[] { "<br/>" }, StringSplitOptions.RemoveEmptyEntries);
        string[]   array2 = null;
        string[]   array3 = null;
        YuyueLimit limit;

        for (int i = 0; i < array1.Length; i++)
        {
            limit           = new YuyueLimit();
            limit.WeekNum   = weeknum;
            limit.Operator  = week.CheckOperator;
            limit.Ksrq      = begin.AddDays(dayofweek - 1).ToString("yyyy-MM-dd");
            limit.DayOfWeek = dayofweek;
            array2          = array1[i].Split(';');
            array3          = array2[0].Split(':');
            limit.KsddCode  = array3[0];
            limit.Ksdd      = array3[1];

            array3         = array2[1].Split(':');
            limit.KsccCode = array3[0];
            limit.Kscc     = array3[1];

            array3           = array2[2].Split(':');
            limit.SchoolCode = array3[0];
            limit.SchoolName = array3[1];

            limit.Km = km;

            limit.Total = Int32.Parse(array2[3]);
            SimpleOrmOperator.Create(limit);
        }
        // SimpleOrmOperator.Delete<YuyueLimit>(id);
    }
Exemplo n.º 9
0
    public static void Save(WeekRecord week,int dayofweek,int km,string begindate,string desc)
    {
        if (desc == null || desc.Length == 0)
        {
            return;
        }
        int weeknum = week.WeekNum;
        DateTime begin = DateTime.Parse(begindate);
        ArrayList lists = new ArrayList();
        string[] array1 = desc.Trim("<br/>".ToCharArray()).Split(new string[]{"<br/>"},StringSplitOptions.RemoveEmptyEntries);
        string[] array2 = null;
        string[] array3 = null;
        YuyueLimit limit;
        for (int i = 0; i < array1.Length; i++)
        {
            limit = new YuyueLimit();
            limit.WeekNum = weeknum;
            limit.Operator = week.CheckOperator;
            limit.Ksrq = begin.AddDays(dayofweek-1).ToString("yyyy-MM-dd");
            limit.DayOfWeek = dayofweek;
            array2 = array1[i].Split(';');
            array3 = array2[0].Split(':');
            limit.KsddCode = array3[0];
            limit.Ksdd = array3[1];

            array3 = array2[1].Split(':');
            limit.KsccCode = array3[0];
            limit.Kscc = array3[1];

            array3 = array2[2].Split(':');
            limit.SchoolCode = array3[0];
            limit.SchoolName = array3[1];

            limit.Km = km;

            limit.Total =Int32.Parse(array2[3]);
            SimpleOrmOperator.Create(limit);

        }
           // SimpleOrmOperator.Delete<YuyueLimit>(id);
    }
Exemplo n.º 10
0
    private void InitYuyueLimit(YuyueLimit entity)
    {
        this.cbKscc.SelectedValue = entity.KsccCode;
        this.cbKsdd.SelectedValue = entity.KsddCode;
        this.lbYkrq.Text          = entity.Ksrq;
        this.cbKm.SelectedValue   = entity.Km.ToString();
        this.hidPaiBanId.Value    = entity.Id.ToString();
        this.lbSchoolName.Text    = this.Operator.Desp4;
        string sql = "select id,c_lsh,c_idcard,c_xm,date_pxshrq,c_hmhp,c_jbr,decode(i_checked,0,'未审核',1,'已审核',2,'审核不过') i_checked,c_check_result from table_yuyue_info"
                     + "  where (i_checked<>2 or i_checked is null) and i_paibanid=" + entity.Id;

        dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmp");
        if (dt != null)
        {
            this.trueNum = dt.Rows.Count;
        }
        else
        {
            dt           = MockDataTable();
            this.trueNum = 0;
        }
        int num = entity.Total + entity.TpTotal - trueNum;

        for (int i = 0; i < num; i++)
        {
            dt.Rows.Add(dt.NewRow());
        }
        this.DataGrid1.DataSource = dt;
        this.DataGrid1.DataBind();

        sql = "select id,c_lsh,c_idcard,c_xm,date_pxshrq,c_hmhp,c_jbr,decode(i_checked,0,'未审核',1,'已审核',2,'审核不过') i_checked,c_check_result from table_yuyue_info"
              + "  where i_checked=2 and i_paibanid=" + entity.Id;
        dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmp");
        if (dt != null)
        {
            this.DataGrid2.DataSource = dt;
            this.DataGrid2.DataBind();
        }
    }
Exemplo n.º 11
0
    protected void lbtn_Click(object sender, EventArgs e)
    {
        if (this.hidRowOld.Value != "-1" && this.hidColOld.Value != "-1")
        {
            int j = int.Parse(this.hidColOld.Value);
            int m = int.Parse(this.hidRowOld.Value);
            if (this.GetSl(this.txtNum) > 0)
            {
                // this.Table1.Rows[m].Cells[j + 2].Text += "<br/>" + this.cbKsdd.SelectedItem.Value + ":" +
                //        this.cbKsdd.SelectedItem.Text + ";" + this.cbKscc.SelectedItem.Value
                //        + ":" + this.cbKscc.SelectedItem.Text + ";"
                //        + this.cbSchool.SelectedItem.Value + ":" + this.cbSchool.SelectedItem.Text + ";" + this.txtNum.Text.Trim();
                string context = string.Format("<br/>{0}({1})", this.cbSchool.SelectedItem.Text, this.txtNum.Text.Trim());
                this.Table1.Rows[m].Cells[j + 2].Text += context;
                int km         = (j + 2) / 2;
                int datyOfWeek = m - 1;

                WeekRecord weekRecord = ViewState[VIEWSTATUE_WEEKRECORD] as WeekRecord;
                ArrayList  limits     = ViewState[VIEWSTATUE_LIMITS] as ArrayList;
                YuyueLimit tempLimit  = new YuyueLimit();
                tempLimit.DayOfWeek  = datyOfWeek;
                tempLimit.Km         = km;
                tempLimit.WeekNum    = weekRecord.WeekNum;
                tempLimit.Ksdd       = this.cbKsdd.SelectedItem.Text;
                tempLimit.KsddCode   = this.cbKsdd.SelectedItem.Value;
                tempLimit.Kscc       = this.cbKscc.SelectedItem.Text;
                tempLimit.KsccCode   = this.cbKscc.SelectedItem.Value;
                tempLimit.SchoolName = this.cbSchool.SelectedItem.Text;
                tempLimit.SchoolCode = this.cbSchool.SelectedItem.Value;
                tempLimit.Total      = int.Parse(this.txtNum.Text.Trim());
                limits.Add(tempLimit);
                ViewState[VIEWSTATUE_LIMITS] = limits;
            }
            else
            {
                WebTools.Alert("分配的数量不得为0!");
            }
        }
    }
Exemplo n.º 12
0
    protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e)
    {
        if (e.CommandName == "Tp")
        {
            int tp = 0;
            try
            {
                tp = Convert.ToInt32(this.txtNum.Text.Trim());
            }
            catch (Exception ex)
            {
                WebTools.Alert(this, "特批数量必须是整数!");
                return;
            }
            int        id    = Convert.ToInt32(e.CommandArgument);
            YuyueLimit limit = YuyueLimitOperator.Get(id);
            limit.TpTotal = tp;

            YuyueLimitOperator.Update(limit);
            WebTools.Alert(this, "特批成功!");
            this.ProcedurePager1.Changed = true;
        }
    }
Exemplo n.º 13
0
 private static String genLimitKey(YuyueLimit limit)
 {
     String key = "";
     key = string.Format("{0}::{1}::{2}::{3}::{4}::{5}",
         limit.WeekNum
         ,limit.DayOfWeek
         ,limit.Km
         ,limit.KsccCode
         ,limit.KsddCode
         ,limit.SchoolCode
         );
     return key;
 }
Exemplo n.º 14
0
 public static void Update(YuyueLimit limit)
 {
     SimpleOrmOperator.Update(limit);
 }
Exemplo n.º 15
0
 public static bool Save(WeekRecord week, YuyueLimit limit,DateTime beginDate)
 {
     limit.Operator = week.CheckOperator;
     limit.Ksrq = beginDate.AddDays(limit.DayOfWeek - 1).ToString("yyyy-MM-dd");
     return SimpleOrmOperator.Create(limit);
 }
Exemplo n.º 16
0
    protected void lbtn_Click(object sender, EventArgs e)
    {
        if (this.hidRowOld.Value != "-1" && this.hidColOld.Value != "-1")
        {
            int j = int.Parse(this.hidColOld.Value);
            int m = int.Parse(this.hidRowOld.Value);
            if (this.GetSl(this.txtNum) > 0)
            {
               // this.Table1.Rows[m].Cells[j + 2].Text += "<br/>" + this.cbKsdd.SelectedItem.Value + ":" +
               //        this.cbKsdd.SelectedItem.Text + ";" + this.cbKscc.SelectedItem.Value
               //        + ":" + this.cbKscc.SelectedItem.Text + ";"
               //        + this.cbSchool.SelectedItem.Value + ":" + this.cbSchool.SelectedItem.Text + ";" + this.txtNum.Text.Trim();
                string context = string.Format("<br/>{0}({1})",this.cbSchool.SelectedItem.Text,this.txtNum.Text.Trim());
                this.Table1.Rows[m].Cells[j + 2].Text += context;
                int km=(j+2)/2;
                int datyOfWeek=m-1;

                WeekRecord weekRecord=ViewState[VIEWSTATUE_WEEKRECORD] as WeekRecord;
                ArrayList limits = ViewState[VIEWSTATUE_LIMITS] as ArrayList;
                YuyueLimit tempLimit = new YuyueLimit();
                tempLimit.DayOfWeek = datyOfWeek;
                tempLimit.Km = km;
                tempLimit.WeekNum = weekRecord.WeekNum;
                tempLimit.Ksdd = this.cbKsdd.SelectedItem.Text;
                tempLimit.KsddCode =this.cbKsdd.SelectedItem.Value;
                tempLimit.Kscc = this.cbKscc.SelectedItem.Text;
                tempLimit.KsccCode = this.cbKscc.SelectedItem.Value;
                tempLimit.SchoolName = this.cbSchool.SelectedItem.Text;
                tempLimit.SchoolCode = this.cbSchool.SelectedItem.Value;
                tempLimit.Total = int.Parse(this.txtNum.Text.Trim());
                limits.Add(tempLimit);
                ViewState[VIEWSTATUE_LIMITS] = limits;
            }
            else
            {
                WebTools.Alert("分配的数量不得为0!");
            }
        }
    }
Exemplo n.º 17
0
 public static bool Save(WeekRecord week, YuyueLimit limit, DateTime beginDate)
 {
     limit.Operator = week.CheckOperator;
     limit.Ksrq     = beginDate.AddDays(limit.DayOfWeek - 1).ToString("yyyy-MM-dd");
     return(SimpleOrmOperator.Create(limit));
 }
Exemplo n.º 18
0
 private void InitYuyueLimit(YuyueLimit entity)
 {
     this.cbKscc.SelectedValue = entity.KsccCode;
     this.cbKsdd.SelectedValue = entity.KsddCode;
     this.lbYkrq.Text = entity.Ksrq;
     this.cbKm.SelectedValue = entity.Km.ToString();
     this.hidPaiBanId.Value = entity.Id.ToString();
     this.lbSchoolName.Text = "非培训队报考人员";
 }
Exemplo n.º 19
0
 public static void Update(YuyueLimit limit)
 {
     SimpleOrmOperator.Update(limit);
 }
Exemplo n.º 20
0
    private void InitYuyueLimit(YuyueLimit entity)
    {
        this.cbKscc.SelectedValue = entity.KsccCode;
        this.cbKsdd.SelectedValue = entity.KsddCode;
        this.lbYkrq.Text = entity.Ksrq;
        this.cbKm.SelectedValue = entity.Km.ToString();
        this.hidPaiBanId.Value = entity.Id.ToString();
        this.lbSchoolName.Text = this.Operator.Desp4;
        string sql = "select id,c_lsh,c_idcard,c_xm,date_pxshrq,c_hmhp,c_jbr,decode(i_checked,0,'未审核',1,'已审核',2,'审核不过') i_checked,c_check_result from table_yuyue_info"
            + "  where (i_checked<>2 or i_checked is null) and i_paibanid="+entity.Id;
        dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql,"tmp");
        if (dt != null)
        {
            this.trueNum = dt.Rows.Count;

        }
        else
        {
            dt = MockDataTable();
            this.trueNum = 0;
        }
        int num = entity.Total + entity.TpTotal - trueNum;
        for (int i = 0; i < num; i++)
        {
            dt.Rows.Add(dt.NewRow());
        }
        this.DataGrid1.DataSource = dt;
        this.DataGrid1.DataBind();

        sql = "select id,c_lsh,c_idcard,c_xm,date_pxshrq,c_hmhp,c_jbr,decode(i_checked,0,'未审核',1,'已审核',2,'审核不过') i_checked,c_check_result from table_yuyue_info"
           + "  where i_checked=2 and i_paibanid=" + entity.Id;
        dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmp");
        if (dt != null)
        {
            this.DataGrid2.DataSource = dt;
            this.DataGrid2.DataBind();

        }
    }