Exemple #1
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string smpFtrNm = cmbSampleFeatureClass.Text;
            string depFld   = cmbDepedent.Text;
            int    ent      = System.Convert.ToInt32(nudEnter.Value);
            int    sty      = System.Convert.ToInt32(nudStay.Value);
            string wght     = cmbWeight.Text;

            if (wght != null && wght != "")
            {
                WEIGHT = wght;
            }
            bool rslt    = chbResults.Checked;
            bool val     = chbValidate.Checked;
            bool edSas   = chbSas.Checked;
            bool stepSel = chbStepWise.Checked;

            if (smpFtrNm == null || smpFtrNm == "")
            {
                MessageBox.Show("You must select a feature Class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (depFld == null || depFld == "")
            {
                MessageBox.Show("You must select a dependent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            List <string> lstInd = new List <string>();

            for (int i = 0; i < lstIndependent.Items.Count; i++)
            {
                string s = lstIndependent.Items[i].ToString();
                lstInd.Add(s);
            }
            if (lstInd.Count < 1)
            {
                MessageBox.Show("You must select at least one independent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Visible = false;
            IFeatureClass            ftrCls = ftrDic[smpFtrNm];
            polytomousLogisticRaster plrR   = new polytomousLogisticRaster();

            plrR.Dependentfield    = depFld;
            plrR.IndependentFields = lstInd.ToArray();
            plrR.OutWorkspace      = ((IDataset)ftrCls).Workspace;
            plrR.SampleLocations   = ftrCls;
            plrR.Validate          = val;
            plrR.ClassFields       = lstCategoricalFlds.ToArray();
            plrR.WeightField       = WEIGHT;
            plrR.StepWiseSelection = stepSel;
            plrR.SlEnter           = ent;
            plrR.SlStay            = sty;
            plrR.runSasProcedure();
            if (rslt == true)
            {
                plrR.showModelOutput();
            }
            if (edSas == true)
            {
                plrR.editSasFile();
            }
            this.Close();
        }
 private void btnExecute_Click(object sender, EventArgs e)
 {
     string smpFtrNm = cmbSampleFeatureClass.Text;
     string depFld = cmbDepedent.Text;
     int ent = System.Convert.ToInt32(nudEnter.Value);
     int sty = System.Convert.ToInt32(nudStay.Value);
     string wght = cmbWeight.Text;
     if(wght!=null&&wght!="")
     {
         WEIGHT = wght;
     }
     bool rslt = chbResults.Checked;
     bool val = chbValidate.Checked;
     bool edSas = chbSas.Checked;
     bool stepSel = chbStepWise.Checked;
     if (smpFtrNm == null || smpFtrNm == "")
     {
         MessageBox.Show("You must select a feature Class","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return;
     }
     if (depFld == null || depFld == "")
     {
         MessageBox.Show("You must select a dependent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     List<string> lstInd = new List<string>();
     for (int i = 0; i < lstIndependent.Items.Count; i++)
     {
         string s = lstIndependent.Items[i].ToString();
         lstInd.Add(s);
     }
     if (lstInd.Count < 1)
     {
         MessageBox.Show("You must select at least one independent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     this.Visible = false;
     IFeatureClass ftrCls = ftrDic[smpFtrNm];
     polytomousLogisticRaster plrR = new polytomousLogisticRaster();
     plrR.Dependentfield = depFld;
     plrR.IndependentFields = lstInd.ToArray();
     plrR.OutWorkspace = ((IDataset)ftrCls).Workspace;
     plrR.SampleLocations = ftrCls;
     plrR.Validate = val;
     plrR.ClassFields = lstCategoricalFlds.ToArray();
     plrR.WeightField = WEIGHT;
     plrR.StepWiseSelection = stepSel;
     plrR.SlEnter = ent;
     plrR.SlStay = sty;
     plrR.runSasProcedure();
     if (rslt==true)
     {
         plrR.showModelOutput();
     }
     if (edSas==true)
     {
         plrR.editSasFile();
     }
     this.Close();
 }