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);
        }
        protected override void DeleteRecord(long KeyID)
        {
            /*
            Customer DeleteRecord Rights
            A Question Record can be deleted by:
                The user who created the record and has the Delete Rights and the record is not approved.
                A user who has the Delete and View Rights and the record is not approved.
            */

            Keys ClsKey = new Keys();
            ClsKey.Add("RecruitmentTestQuestionsID", Convert.ToInt64(KeyID));

            ClsQuestion Obj_Question = new ClsQuestion(this.pCurrentUser);
            Obj_Question.Load(ClsKey);

            if (this.pCurrentUser.CheckAccess(Layer02_Constants.eSystem_Modules.Question, Layer02_Constants.eAccessLib.eAccessLib_Delete))
            {
                Int64 CurrentUserID = Do_Methods.Convert_Int64(this.pCurrentUser.pDrUser["RecruitmentTestUserID"], 0);
                Int64 OwnerUserID = Do_Methods.Convert_Int64(Obj_Question.pDr["RecruitmentTestUserID_CreatedBy"], 0);
                bool IsApproved = Do_Methods.Convert_Boolean(Obj_Question.pDr["IsApproved"]);

                if (!
                        (
                            (
                                (CurrentUserID == OwnerUserID)
                                || (this.pCurrentUser.CheckAccess(Layer02_Constants.eSystem_Modules.Question, Layer02_Constants.eAccessLib.eAccessLib_View))
                            )
                            && (!IsApproved)
                        )
                    )
                { this.Show_EventMsg("You can't delete this question.", ClsBaseMain_Master.eStatus.Event_Error); }
                else
                { Obj_Question.Delete(); }
            }
            this.pGridList.RebindGrid();
        }
        public override void Load(Keys Keys = null)
        {
            base.Load(Keys);
            this.CheckIfDeleted();

            //[-]

            Int64 QuestionID = Convert.ToInt64(Do_Methods.IsNull(this.pDr["RecruitmentTestQuestionsID"], 0));
            if (QuestionID != 0)
            {
                Keys = new Keys();
                Keys.Add("Lkp_RecruitmentTestQuestionsID", QuestionID);
            }
            else
            { Keys = null; }

            this.mBL_QuestionAnswer.Load(Keys, this);

            //foreach (DataRow Dr in this.mBL_QuestionAnswer.pDt_List.Rows)
            //{
            //    ClsAnswer Inner_Obj = new ClsAnswer();
            //    ClsKeys Inner_Keys = null;
            //    Int64 Inner_ID = Convert.ToInt64(Do_Methods.IsNull(Dr["Lkp_RecruitmentTestAnswersID"], 0));

            //    if (Inner_ID != 0)
            //    {
            //        Inner_Keys = new ClsKeys();
            //        Inner_Keys.Add("RecruitmentTestAnswersID", Inner_ID);
            //    }

            //    Inner_Obj.Load(Inner_Keys);
            //    this.mBO_Answer.Add(Convert.ToInt64(Do_Methods.IsNull(Dr["TmpKey"], 0)).ToString(), Inner_Obj);
            //}

            //DataRow[] ArrDr = this.mBL_QuestionAnswer.pDt_List.Select("", "OrderIndex");
            //int Ct = 0;
            //foreach (DataRow Dr in ArrDr)
            //{
            //    Ct++;
            //    Dr["OrderIndex"] = Ct;
            //}

            //this.FixOrderIndex(true);
            //this.mBL_QuestionAnswer.pDt_List.DefaultView.Sort = "OrderIndex";
        }
Example #4
0
        protected override void Save_Add()
        {
            if (this.mLookupID == 0)
            {
                foreach (DataRow Dr in base.mDt_List.Rows)
                {
                    ClsRowProperty Rp = new ClsRowProperty(this.mCurrentUser);
                    Keys Keys = new Keys();

                    Int64 RowPropertyID = Do_Methods.Convert_Int64(Dr["RowPropertyID"]);
                    if (RowPropertyID == 0)
                    { Keys = null; }
                    else
                    { Keys.Add("RowPropertyID", RowPropertyID); }

                    Rp.Load(Keys);

                    Rp.pDr["Code"] = Do_Methods.Convert_String(Dr["Code"]);
                    Rp.pDr["Remarks"] = Do_Methods.Convert_String(Dr["Desc"]);

                    Rp.Save();
                    Dr["RowPropertyID"] = Rp.pDr["RowPropertyID"];
                }
            }
            else
            {
                foreach (DataRow Dr in base.mDt_List.Rows)
                { Dr["LookupID"] = this.mLookupID; }
            }
        }
Example #5
0
        public void Login_Mayari(Int64 MayariID)
        {
            Keys Key = new Keys();
            Key.Add("MayariID", MayariID);

            ClsMayari Obj_Mayari = new ClsMayari(null);
            Obj_Mayari.Load(Key);

            this.mDr_Mayari = Obj_Mayari.pDr;
            this.pIsLoggedIn = true;
        }
        protected virtual void Delete()
        {
            Int64 KeyID = this.pObj_Base.pID;
            Keys ClsKey = new Keys();
            ClsKey.Add(this.pObj_Base.pHeader_TableKey, KeyID);

            Base Obj_Base = (Base)Activator.CreateInstance(this.pObj_Base.GetType(), new object[] { this.pCurrentUser });
            Obj_Base.Load(ClsKey);
            Obj_Base.Delete();
        }
        public void DeleteRecord(Int64 KeyID)
        {
            if (this.mProperties.DataSourceType != eDataSourceType.FromBase)
            { return; }

            if (!this.pCurrentUser.CheckAccess(this.pSystem_ModulesID, Layer02_Constants.eAccessLib.eAccessLib_Delete))
            { throw new CustomException("You have no rights to delete this record."); }

            Keys ClsKey = new Keys();
            ClsKey.Add(this.pProperties.BindDefinition.KeyName, Convert.ToInt64(KeyID));

            Base Obj_Base = (Base)Activator.CreateInstance(this.mObj_Base.GetType(), new object[] { this.pCurrentUser });
            Obj_Base.Load(ClsKey);
            Obj_Base.Delete();

            this.pGridList.RebindGrid(this.pFilterList.pQc);
        }
        public void LoadExam(Int64 ExamID, Int64 ItemsLimit)
        {
            DataTable Dt_Exam = Do_Methods_Query.GetQuery("RecruitmentTestExams", "", "RecruitmentTestExamsID = " + ExamID);
            Int64 ApplicantID = 0;
            if (Dt_Exam.Rows.Count > 0)
            {
                this.mDr_Exam = Dt_Exam.Rows[0];
                ApplicantID = Convert.ToInt64(Do_Methods.IsNull(this.mDr_Exam["RecruitmentTestApplicantID"], 0));
            }
            else
            { throw new Exception("Exam Data not found."); }

            Keys Key = new Keys();
            Key.Add("RecruitmentTestApplicantID", ApplicantID);

            this.mObj_Applicant = new ClsApplicant();
            this.mObj_Applicant.Load(Key);

            DataSet Ds = this.mEm.LoadExam(ExamID);
            this.mDs = Ds;
            this.mDt_Question = Ds.Tables[0];
            this.mDt_Question_Answer = Ds.Tables[1];

            this.mDt_Question.Columns.Add("Ct", typeof(Int64));
            Int64 Ct = 0;
            foreach (DataRow Dr in this.mDt_Question.Rows)
            {
                Ct++;
                Dr["Ct"] = Ct;
            }

            this.mDt_Question_Answer.Columns.Add("Ct", typeof(Int64));
            Ct = 0;
            foreach (DataRow Dr in this.mDt_Question_Answer.Rows)
            {
                Ct++;
                Dr["Ct"] = Ct;
            }

            this.mItemsLimit = ItemsLimit;
            this.mItems = this.mDt_Question.Rows.Count;

            this.mPages = this.mItems / this.mItemsLimit;
            if (this.mItems % this.mItemsLimit > 0)
            { this.mPages++; }
        }
        public override void Load(Keys Keys = null)
        {
            base.Load(Keys);

            //[-]

            Int64 ContactPersonID = Convert.ToInt64(Do_Methods.IsNull(this.pDr["ContactPersonID"], 0));

            if (ContactPersonID != 0)
            {
                Keys = new Keys();
                Keys.Add("ContactPersonID", ContactPersonID);
            }
            else
            { Keys = null; }

            this.mObj_ContactPerson.Load(Keys);

            //this.mObj_ShippingAddress.Load(Keys, this);

            //[-]

            //foreach (DataRow Dr in this.pDt_ShippingAddress.Rows)
            //{
            //    ClsAddress Inner_Obj = new ClsAddress(this.mCurrentUser);
            //    Keys Inner_Keys = null;
            //    Int64 Inner_ID = Convert.ToInt64(Do_Methods.IsNull(Dr["AddressID"], 0));
            //    if (Inner_ID != 0)
            //    {
            //        Inner_Keys = new Keys();
            //        Inner_Keys.Add("AddressID", Inner_ID);
            //    }
            //    Inner_Obj.Load(Inner_Keys);
            //    this.mBO_ShippingAddress_Address.Add(Convert.ToInt64(Do_Methods.IsNull(Dr["TmpKey"], 0)).ToString(), Inner_Obj);
            //}
        }
        void SetupPage()
        {
            this.SetupPage_Properties();

            //[-]

            Int64 ID = Do_Methods.Convert_Int64(this.Request.QueryString["ID"]);
            this.pIsNew = ID == 0;

            this.Raise_SetupPage_Rights();

            //[-]

            this.Session[CnsBase + this.pObjID] = this.mObj_Base;

            ClsSysCurrentUser CurrentUser = this.Master.pCurrentUser;

            Keys Key = null;

            if (ID != 0)
            {
                Key = new Keys();
                Key.Add(this.mObj_Base.pHeader_TableKey, ID);
            }

            this.mObj_Base.Load(Key);
        }