예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString[SystemConstants.StateID] != null)
                {
                    int stateID = Convert.ToInt32(Request.QueryString[SystemConstants.StateID]);
                    var dac     = new AdministrationDAC();
                    AdministrationEDSC.StateDTRow dr = null;

                    if (stateID != 0)
                    {
                        dr = dac.RetrieveState(stateID);
                        StateSetupUC1.Mode = SystemConstants.FormMode.Edit;
                        StateSetupUC1.SetData(dr);
                    }
                    else
                    {
                        dr = new AdministrationEDSC.StateDTDataTable().NewStateDTRow();
                        StateSetupUC1.Mode = SystemConstants.FormMode.New;
                    }
                }
                CheckSignIn();
            }
        }
예제 #2
0
        protected void lnkDelete_Click(object sender, EventArgs e)
        {
            AdministrationDAC dac = new AdministrationDAC();

            AdministrationEDSC.StateDTDataTable dt = GetSelected();
            foreach (AdministrationEDSC.StateDTRow dr in dt)
            {
                dac.DeleteState(dr.ID);
            }
            Refresh();
        }
예제 #3
0
        public AdministrationEDSC.StateDTRow GetData()
        {
            AdministrationEDSC.StateDTRow dr = new AdministrationEDSC.StateDTDataTable().NewStateDTRow();

            if (!string.IsNullOrEmpty(hdnStateID.Value))
            {
                dr.ID = Convert.ToInt32(hdnStateID.Value);
            }
            dr.StateName   = txtAddEditName.Text;
            dr.StateDetail = txtFullName.Text;
            return(dr);
        }
예제 #4
0
 private AdministrationEDSC.StateDTDataTable GetSelected()
 {
     AdministrationEDSC.StateDTDataTable dt = new AdministrationEDSC.StateDTDataTable();
     foreach (GridViewRow row in GridView1.Rows)
     {
         if (row.RowType == DataControlRowType.DataRow)
         {
             CheckBox    CheckBox1 = row.FindControl("chkboxSelected") as CheckBox;
             HiddenField hdnID     = row.FindControl("hdnID") as HiddenField;
             var         dr        = dt.NewStateDTRow();
             if (CheckBox1.Checked)
             {
                 dr.ID = Convert.ToInt32(hdnID.Value);
                 dt.AddStateDTRow(dr);
             }
         }
     }
     return(dt);
 }
예제 #5
0
        protected void lnkOk1_Click(object sender, EventArgs e)
        {
            AdministrationEDSC.StateDTRow dr = new AdministrationEDSC.StateDTDataTable().NewStateDTRow();
            dr = GetData();

            string userName = SystemConstants.DevUser;
            //Membership.GetUser().UserName;

            AdministrationDAC dac = new AdministrationDAC();

            if (Mode == SystemConstants.FormMode.New)
            {
                dac.CreateState(userName, dr);
            }
            else if (Mode == SystemConstants.FormMode.Edit)
            {
                dac.UpdateState(userName, dr);
            }
            Mode = SystemConstants.FormMode.View;
            SetData(dr);
        }