protected void cmdMoveOk_Click(object sender, EventArgs e) { try { string iidstr = txtIidstr.Value; int dest_cid = int.Parse(ddlMovecid.SelectedValue); int dest_pid = int.Parse(ddlMovepid.SelectedValue); bool getchild = chkMoveoption_getchild.Checked; lstError = new List<Errorobject>(); if (CFunctions.IsNullOrEmpty(iidstr) || dest_cid == 0) { lstError = Form_GetError(lstError, Errortype.Error, Definephrase.Move_error, "", null); Master.Form_ShowError(lstError); return; } CMenu BLL = new CMenu(CCommon.LANG); MenuInfo parent_info = BLL.Wcmm_Getinfo(dest_pid); int dest_depth = parent_info == null ? 1 : parent_info.Depth; string[] iidarr = iidstr.Split(','); bool isDup = false; for (int i = 0; i < iidarr.Length; i++) { MenuInfo info = BLL.Wcmm_Getinfo(int.Parse(iidarr[i])); if (info.Id != dest_pid) { if (info.Pid != 0) BLL.Updatenum(info.Pid.ToString(), Queryparam.Sqlcolumn.Pis, CConstants.NUM_DECREASE); this.Move_Info(info, dest_cid, dest_pid, dest_depth, getchild, BLL); } else isDup = true; } if (parent_info != null) { int pis = parent_info.Pis == 0 ? iidarr.Length + 1 : iidarr.Length + parent_info.Pis; if (isDup) pis--; BLL.Updatenum(dest_pid.ToString(), Queryparam.Sqlcolumn.Pis, pis); } cmdMoveOk.Enabled = false; lstError = Form_GetError(lstError, Errortype.Completed, Definephrase.Move_completed, "", null); Master.Form_ShowError(lstError); } catch (Exception ex) { CCommon.CatchEx(ex); } }