コード例 #1
0
    protected void LoadData(string TableName, int DetailCode)
    {
        BOLClass.QueryObjName = TableName;
        DataTable dt = BOLClass.GetDetails(DetailCode);

        if (dt != null)
        {
            txtName.Text        = dt.Rows[0]["Name"].ToString();
            txtDescription.Text = dt.Rows[0]["Description"].ToString();
        }
    }
コード例 #2
0
    protected void LoadData(int DetailCode)
    {
        Keywords ObjBaseID = BOLClass.GetDetails(DetailCode);
        Tools    tools     = new Tools();

        tools.AccessList = tools.GetAccessList(BaseID);
        if (ObjBaseID != null)
        {
            tools.ShowControl("Keywords.Name", txtName, ObjBaseID.Name, BOLClass);
            tools.ShowControl("Keywords.EngName", txtEngName, ObjBaseID.EngName, BOLClass);
            tools.ShowControl("Keywords.Description", txtDescription, ObjBaseID.Description, BOLClass);
        }
    }
コード例 #3
0
    protected void LoadData(int DetailCode)
    {
        Resources ObjBaseID = BOLClass.GetDetails(DetailCode);
        Tools     tools     = new Tools();

        if (ObjBaseID != null)
        {
            tools.ShowControl("Resources.Name", txtName, ObjBaseID.Name, BOLClass);
            tools.ShowControl("Resources.EngName", txtEngName, ObjBaseID.EngName, BOLClass);
            tools.ShowControl("Resources.TypeCode", lkpTypeCode, ObjBaseID.HCResourceTypeCode, BOLClass);
            tools.ShowControl("Resources.MasterCode", lkpMasterCode, ObjBaseID.MasterCode, BOLClass);
            tools.ShowControl("Resources.EditPath", txtEditPath, ObjBaseID.EditPath, BOLClass);
            tools.ShowControl("Resources.BaseID", txtBaseID, ObjBaseID.BaseID, BOLClass);
            tools.ShowControl("Resources.BasicAccessType", txtBasicAccessType, ObjBaseID.BasicAccessType, BOLClass);
            tools.ShowControl("Resources.ResName", txtResName, ObjBaseID.ResName, BOLClass);
        }
    }
コード例 #4
0
ファイル: EditFormDetail.cs プロジェクト: bidaad/ChandSanieh
    protected virtual void LoadData(int DetailCode)
    {
        Tools tools = new Tools();

        tools.AccessList = tools.GetAccessList(this.BaseID);

        if (!tools.HasAccess("Edit", BaseID) || Request["ViewMode"] == "1")
        {
            ContentPlaceHolder cph     = ((ContentPlaceHolder)((Page)(HttpContext.Current.Handler)).Master.FindControl("cphMain"));
            ImageButton        SaveBtn = (ImageButton)cph.FindControl("imgBtnSave");
            SaveBtn.Visible = false;
        }
        var ObjBaseID = BOLClass.GetDetails(DetailCode);

        if (ObjBaseID != null)
        {
            #region Full Load Data
            #region Automatic Load Data
            Type              t            = System.Web.Compilation.BuildManager.GetType("BOL" + BaseID, true);
            IBaseBOL          CurObj       = (IBaseBOL)Activator.CreateInstance(t, new object[] { (int)MasterCode });
            List <WebControl> listControls = new Tools().GetControls();
            foreach (WebControl wc in listControls)
            {
                string       Property     = wc.ID.Substring(3, wc.ID.Length - 3);
                PropertyInfo pi           = ObjBaseID.GetType().GetProperty(Property);
                string       FullPropName = BaseID + "." + Property;
                #region Cast controls to label if view mode
                //if (!string.IsNullOrEmpty(wc.Attributes["jas"]) && wc.Attributes["jas"] == "1")
                if (Request["ViewMode"] == "1")
                {
                    if (wc is ICustomControlsBase)
                    {
                        ((ICustomControlsBase)wc).DisplayMode = EnmDisplayMode.ViewMode;
                    }
                }
                //else
                //    wc.Enabled = false;

                #endregion
                tools.ShowControl(FullPropName, wc, pi.GetValue(ObjBaseID, new object[] { }), CurObj);
            }
            #endregion
            #endregion
        }
    }
コード例 #5
0
ファイル: EditForm.cs プロジェクト: bidaad/ChandSanieh
    //protected void EditForm_Page_Load(object sender, EventArgs e)
    //{
    //    int aa = 1;
    //}
    protected virtual object LoadData(int DetailCode)
    {
        int HCLevelCode   = 0;
        int DBHCLevelCode = 0;

        if (Session["HCLevelCode"] != null)
        {
            HCLevelCode = Convert.ToInt32(Session["HCLevelCode"]);
        }

        Tools tools = new Tools();

        tools.AccessList = tools.GetAccessList(this.BaseID);
        var ObjBaseID = BOLClass.GetDetails(DetailCode);

        if (ObjBaseID != null)
        {
            #region Full Load Data
            #region Automatic Load Data
            Type     t      = System.Web.Compilation.BuildManager.GetType("BOL" + BaseID, true);
            IBaseBOL CurObj = (IBaseBOL)Activator.CreateInstance(t);

            List <WebControl> listControls = new Tools().GetControls();
            foreach (WebControl wc in listControls)
            {
                string       Property     = wc.ID.Substring(3, wc.ID.Length - 3);
                PropertyInfo pi           = ObjBaseID.GetType().GetProperty(Property);
                string       FullPropName = BaseID + "." + Property;
                if (Property == "HCLevelCode")
                {
                    DBHCLevelCode = Convert.ToInt32(pi.GetValue(ObjBaseID, new object[] { }));
                }
                tools.ShowControl(FullPropName, wc, pi.GetValue(ObjBaseID, new object[] { }), CurObj);
            }
            #endregion
            #endregion
        }
        if (HCLevelCode < DBHCLevelCode)
        {
            Response.Redirect("~/Main/?BaseID=" + BaseID);
        }

        return(ObjBaseID);
    }