Пример #1
0
 protected void ctlProvinceFormView_ItemCommand(object sender, FormViewCommandEventArgs e)
 {
     if (e.CommandName == "Cancel")
     {
         ctlProvinceModalPopupExtender.Hide();
         UpdatePanelProvinceForm.Update();
         ctlGridProvince.DataCountAndBind();
     }
 }
Пример #2
0
        protected void ctlBtnAddProvince_Click(object sender, ImageClickEventArgs e)
        {
            ctlProvinceFormView.DataSource = null;
            ctlProvinceFormView.ChangeMode(FormViewMode.Insert);

            UpdatePanelProvinceForm.Update();
            ctlProvinceModalPopupExtender.Show();
            ProvinceLangGridViewFinish();
        }
Пример #3
0
        protected void ctlGridProvince_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ProvinceEdit")
            {
                int   rowIndex   = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
                short ProvinceId = UIHelper.ParseShort(ctlGridProvince.DataKeys[rowIndex].Value.ToString());

                ctlGridProvince.EditIndex = rowIndex;

                IList <DbProvince> provinceList = new List <DbProvince>();
                DbProvince         province     = DbProvinceService.FindByIdentity(ProvinceId);

                provinceList.Add(province);

                ctlProvinceFormView.DataSource = provinceList;
                ctlProvinceFormView.PageIndex  = 0;

                ctlProvinceFormView.ChangeMode(FormViewMode.Edit);
                ctlProvinceFormView.DataBind();

                UpdatePanelProvinceForm.Update();
                ctlProvinceModalPopupExtender.Show();
                ProvinceLangGridViewFinish();
            }
            else if (e.CommandName == "Select")
            {
                int   rowIndex   = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
                short provinceId = UIHelper.ParseShort(ctlGridProvince.DataKeys[rowIndex].Value.ToString());

                ctlProvinceLangGrid.DataSource = SsDbQueryProvider.DbProvinceLangQuery.FindByProvinceId(provinceId);
                ctlProvinceLangGrid.DataBind();

                if (ctlProvinceLangGrid.Rows.Count > 0)
                {
                    ctlSubmit.Visible = true;
                    ctlCancel.Visible = true;
                    ctlProvinceLangLangFds.Visible = true;
                }
                else
                {
                    ctlSubmit.Visible = false;
                    ctlCancel.Visible = false;
                    ctlProvinceLangLangFds.Visible = false;
                }
                ctlProvinceLangUpdatePanel.Update();
            }
        }