public string Updatenum(int did, string iid, string sqlcolumn, object value) { try { if (!CCommon.Right_upt(CFunctions.Get_Definecatrelate(did, Queryparam.Defstring.Page))) return Definephrase.Invalid_right; CGeneral DAL = new CGeneral(CCommon.LANG, did); if (DAL.Updatenum(iid, sqlcolumn, value)) { return Definephrase.Save_completed; } else return Definephrase.Save_error; } catch (Exception ex) { throw ex; } }
protected void cmdSave_Click(object sender, EventArgs e) { try { CGeneral DAL = new CGeneral(CCommon.LANG, BELONGTO); if (pnlSymbol.Visible) { DAL.Updatestr(IID, Queryparam.Sqlcolumn.Iconex, radSymbol.SelectedValue); } if (pnlStatus.Visible && pnlStatus.Enabled) { if (radStatus.SelectedIndex != -1) DAL.Updatenum(IID, Queryparam.Sqlcolumn.Status, radStatus.SelectedValue); } if (pnlMarkas.Visible) { DAL.Updatenum(IID, Queryparam.Sqlcolumn.Markas, radMarkas.SelectedValue); } if (pnlUser.Visible && !CFunctions.IsNullOrEmpty(ddlUser.SelectedValue)) { DAL.Updatestr(IID, Queryparam.Sqlcolumn.Username, ddlUser.SelectedValue); } MODALPOPUPEXTENDER1.Hide(); Control parent = this; do { parent = (Control)parent.Parent; } while (!(parent is BasePage)); BasePage control = (BasePage)parent; control.Bind_grdView(); } catch (Exception ex) { throw ex; } }
public string Delete(int did, string iid) { try { if (!CCommon.Right_del(CFunctions.Get_Definecatrelate(did, Queryparam.Defstring.Page))) return Definephrase.Invalid_right; CGeneral DAL = new CGeneral(CCommon.LANG, did); int status = CCommon.GetStatus_del(); bool recursive = CFunctions.Get_Definecatrelate(did, Queryparam.Defstring.Recursive) == Queryparam.Defstring.Recursive; //if (DAL.Updatenum(iid, Queryparam.Sqlcolumn.Status, status)) if (DAL.Delete(iid, recursive)) { if ((recursive) && (status == (int)CConstants.State.Status.Deleted)) DAL.Updatepis(iid, CConstants.NUM_DECREASE, iid.Split(',').Length); return Definephrase.Remove_completed; } else return Definephrase.Remove_error; } catch (Exception ex) { throw ex; } }