protected void Page_Load(object sender, EventArgs e)
        {
            Contract contract = new Contract();

            contract.Contrac__num = "%F%";
            ContractProvider provider = new ContractProvider();
            string           size     = provider.GetSize(contract).ToString();

            switch (size.Length)
            {
            case 1:
                this.txt_num.Text = "11F000" + Convert.ToString(Convert.ToInt32(size) + 1);
                break;

            case 2:
                this.txt_num.Text = "11F00" + Convert.ToString(Convert.ToInt32(size) + 1);
                break;

            case 3:
                this.txt_num.Text = "11F0" + Convert.ToString(Convert.ToInt32(size) + 1);
                break;

            case 4:
                this.txt_num.Text = "11F" + Convert.ToString(Convert.ToInt32(size) + 1);
                break;
            }
            if (!IsPostBack)
            {
                this.BindSource();
            }

            this.txt_time.Text = DateTime.Now.Date.ToString();
            this.account.Text  = Session["LOGINED"].ToString();
            this.datetime.Text = this.BindDayWeek();
        }
        protected void btn_result_Click(object sender, EventArgs e)
        {
            Contract         contract = this.AddContract();
            ContractProvider provider = new ContractProvider();

            if (provider.Insert(contract))
            {
                string id = provider.GetSize().ToString();
                Response.Redirect("TrimsSourcing.aspx?id=" + id);
            }
        }
Пример #3
0
        protected void btn_Result_Click(object sender, EventArgs e)
        {
            Contract contract = new Contract();

            contract.Contrac__num = this.txt_Name.Text;
            ContractProvider provider = new ContractProvider();

            this.ListPager1.RecordCount = provider.GetSize(contract);
            this.BindSource(0, this.txt_Name.Text);
            this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange);
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ContractProvider provider = new ContractProvider();
         this.ListPager1.RecordCount = provider.GetSize();
         this.BindSource(0, null);
     }
     this.account.Text           = Session["LOGINED"].ToString();
     this.datetime.Text          = this.BindDayWeek();
     this.ListPager1.PageChange += new PagerEventHandler(ListPager1_PageChange);
 }