예제 #1
0
 protected void btnSubmit_Click(Object Sender, EventArgs e)
 {
     oWorkstation.UpdateVirtualAccounts(intWorkstation, 1);
     if (chkApply.Visible && chkApply.Checked)
     {
         DataSet dsAccounts = oWorkstation.GetAccountsVMware(intWorkstation);
         for (int ii = 2; dsAccounts.Tables[0].Rows.Count > 0 && ii <= intQuantity; ii++)
         {
             DataSet dsCopy  = oWorkstation.GetVirtual(intAnswer, ii);
             int     intCopy = 0;
             if (dsCopy.Tables[0].Rows.Count > 0)
             {
                 intCopy = Int32.Parse(dsCopy.Tables[0].Rows[0]["id"].ToString());
                 oWorkstation.DeleteAccounts(intCopy);
                 foreach (DataRow drAccount in dsAccounts.Tables[0].Rows)
                 {
                     int intUser   = Int32.Parse(drAccount["userid"].ToString());
                     int intAdmin  = Int32.Parse(drAccount["admin"].ToString());
                     int intRemote = Int32.Parse(drAccount["remote"].ToString());
                     oWorkstation.AddAccountFix(0, intCopy, intUser, intAdmin, intRemote);
                 }
                 oWorkstation.UpdateVirtualAccounts(intCopy, 1);
             }
         }
     }
     Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "reload", "<script type=\"text/javascript\">window.opener.location.reload();window.close();<" + "/" + "script>");
 }