public BaseObjs Approve() { BaseObjs Rv = new BaseObjs(); DateTime ServerDate = DateTime.Now; this.mDa.Connect(); this.mDa.BeginTransaction(); try { string[] ArrRightsID = Do_Methods.Convert_String(this.mDa.GetSystemParameter(this.mDa.Connection, Layer02_Constants.CnsExam_DefaultContributor_RightsIDs)).Split(','); DataRow[] ArrDr = this.mDt_List.Select("IsSelected = 1", "", DataViewRowState.CurrentRows); foreach (DataRow Dr in ArrDr) { ClsUser Obj_User = new ClsUser(); Obj_User.Load(); Obj_User.pDr["Name"] = Dr["Name"]; Obj_User.pDr["Password"] = Obj_User.GeneratePassword(6); Obj_User.pDr["Email"] = Dr["Email"]; foreach (string RightsID in ArrRightsID) { DataRow Dr_New = Obj_User.pDt_Rights.NewRow(); Dr_New["RecruitmentTestRightsID"] = Do_Methods.Convert_Int64(RightsID); Dr_New["IsActive"] = true; Obj_User.pDt_Rights.Rows.Add(Dr_New); } Obj_User.Save(this.mDa); Dr["RecruitmentTestUserID"] = Obj_User.pID; Rv.Add(Obj_User.pID.ToString(), Obj_User); Dr["IsApproved"] = true; Dr["DateApproved"] = ServerDate; Dr["RecruitmentTestUserID_ApprovedBy"] = this.mCurrentUser.pDrUser["RecruitmentTestUserID"]; this.mDa.SaveDataRow(Dr, this.mHeader_TableName); } this.mDa.CommitTransaction(); } catch (Exception Ex) { this.mDa.RollbackTransaction(); throw Ex; } finally { this.mDa.Close(); } return Rv; }
void Save() { ClsUser Obj_User = new ClsUser(); Keys Key = new Keys(); Key.Add(Obj_User.pHeader_TableKey, this.Master.pCurrentUser.pUserID); Obj_User.Load(Key); Obj_User.pDr["Password"] = this.Txt_Password.Text; Obj_User.Save(); //[-] Hashtable Ht = new System.Collections.Hashtable(); Ht.Add("IsSave", true); this.Session[Layer01_Constants_Web.CnsSession_TmpObj] = Ht; string Url = this.Request.Url.AbsolutePath; this.Response.Redirect(Url); }