protected void cmdUpdateorder_Click(object sender, ImageClickEventArgs e) { try { if (grdView.Rows.Count == 0) return; CMenu BLL = new CMenu(CCommon.LANG); foreach (GridViewRow row in grdView.Rows) { HiddenField txtId = (HiddenField)row.FindControl("txtId"); TextBox txtOrderd = (TextBox)row.FindControl("txtOrderd"); if (txtId != null && txtOrderd != null) { int id = int.Parse(txtId.Value); int orderd = 0; int.TryParse(txtOrderd.Text, out orderd); BLL.Updatenum(id.ToString(), Queryparam.Sqlcolumn.Orderd, orderd); } lstError = new List<Errorobject>(); lstError = Form_GetError(lstError, Errortype.Completed, Definephrase.Saveorderd_completed, "", null); Master.Form_ShowError(lstError); } } catch { lstError = new List<Errorobject>(); lstError = Form_GetError(lstError, Errortype.Error, Definephrase.Saveorderd_error, "", null); Master.Form_ShowError(lstError); } }
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); } }