private void Filter() { V_Org obj = new V_Org(); obj.Where.GoveID.Value = short.Parse(drpState.SelectedValue); obj.Where.GoveID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal; obj.Where.GoveID.Conjuction = MyGeneration.dOOdads.WhereParameter.Conj.And; obj.Where.PoliceID.Value = int.Parse(dropSection.SelectedValue); obj.Where.PoliceID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal; obj.Where.PoliceID.Conjuction = MyGeneration.dOOdads.WhereParameter.Conj.And; obj.Where.AreaID.Value = int.Parse(drpSubSection.SelectedValue); obj.Where.AreaID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal; obj.Query.AddOrderBy(V_Org.ColumnNames.OrgDescription, MyGeneration.dOOdads.WhereParameter.Dir.ASC); obj.Query.Load(); grdGovernate.DataSource = obj.DefaultView; grdGovernate.DataBind(); }
protected void lnkGovCode_Click(object sender, EventArgs e) { LinkButton lnk = (LinkButton)sender; V_Org obj = new V_Org(); obj.Where.OrgID.Value = new Guid(lnk.CommandArgument); obj.Where.OrgID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal; obj.Query.Load(); string parent = string.IsNullOrEmpty(obj.OrgParentID.ToString()) ? "0" : obj.OrgParentID.ToString(); drpMainOrg.SelectedIndex = drpMainOrg.Items.IndexOf( drpMainOrg.Items.FindByValue(parent)); drpState.SelectedIndex = drpState.Items.IndexOf( drpState.Items.FindByValue(obj.GoveID.ToString())); dropSection.SelectedIndex = dropSection.Items.IndexOf( dropSection.Items.FindByValue(obj.PoliceID.ToString())); drpSubSection.SelectedIndex = drpSubSection.Items.IndexOf( drpSubSection.Items.FindByValue(obj.AreaID.ToString())); txtOfficeName.Text = obj.OrgDescription; chkISOfficeInTown.Checked = obj.OrgType; CurrentOrgID = obj.OrgID; btnSave.Text = "تعديل"; }