Пример #1
0
        private void MapObject(UserFunction oUserFunction, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oUserFunction, new ID(oReader.GetInt32("UFID")));
            oUserFunction.Is_Parent     = oReader.GetBoolean("Is_Parent");
            oUserFunction.ParentID      = oReader.GetInt32("ParentID");
            oUserFunction.Function_Name = oReader.GetString("Function_Name");
            oUserFunction.IsCheck       = oReader.GetBoolean("IsCheck");


            BusinessObject.Factory.SetObjectState(oUserFunction, ObjectState.Saved);
        }
Пример #2
0
        private void MapObject(ManuInterface oManuInterface, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oManuInterface, new ID(oReader.GetInt32("Menu_id")));

            oManuInterface.Parent_id  = oReader.GetInt32("Parent_id");
            oManuInterface.Is_parent  = oReader.GetBoolean("Is_parent");
            oManuInterface.Sub_parent = oReader.GetBoolean("Sub_parent");
            oManuInterface.Menu_title = oReader.GetString("Menu_title");
            oManuInterface.IsCheck    = oReader.GetBoolean("IsCheck");
            oManuInterface.NevigetUrl = oReader.GetString("Nav_url");

            BusinessObject.Factory.SetObjectState(oManuInterface, ObjectState.Saved);
        }
Пример #3
0
        private void MapObject(LoginInterface oLoginInterface, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oLoginInterface, new ID(oReader.GetInt32("user_id")));
            oLoginInterface.user_code     = oReader.GetInt32("user_code");
            oLoginInterface.user_fst_name = oReader.GetString("user_fst_name");
            oLoginInterface.user_lst_name = oReader.GetString("user_lst_name");
            oLoginInterface.user_name     = oReader.GetString("user_name");
            oLoginInterface.user_pass     = oReader.GetString("user_pass");
            oLoginInterface.user_type     = (EnumUserType)oReader.GetInt32("user_type");
            oLoginInterface.user_islogon  = oReader.GetBoolean("user_islogon");
            oLoginInterface.user_lock     = oReader.GetBoolean("user_lock");
            oLoginInterface.user_status   = (EnumUserStatus)oReader.GetInt32("user_status");
            //oLoginInterface.IsAuthorise = oReader.GetBoolean("IsAuthorise");

            BusinessObject.Factory.SetObjectState(oLoginInterface, ObjectState.Saved);
        }
 /// <summary>
 /// Froms the reader.
 /// </summary>
 /// <param name="reader">The reader.</param>
 public virtual void FromReader(IDataReader reader)
 {
     ID             = NullHandler.GetLong(reader["Id"]);
     IsActive       = NullHandler.GetBoolean(reader["IsActive"]);
     IsDeleted      = NullHandler.GetBoolean(reader["IsDeleted"]);
     IsLocked       = NullHandler.GetBoolean(reader["IsLocked"]);
     SystemModstamp = NullHandler.GetDateTime(reader["SystemModstamp"]);
 }
Пример #5
0
        private void MapObject(NewUser oNewUser, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oNewUser, new ID(oReader.GetInt32("user_id")));

            //oNewUser.brn_id = oReader.GetInt32("brn_id");
            //oNewUser.BrName = oReader.GetString("BrName");
            oNewUser.user_fst_name = oReader.GetString("user_fst_name");
            oNewUser.user_lst_name = oReader.GetString("user_lst_name");
            oNewUser.user_code     = oReader.GetString("user_code");
            oNewUser.user_name_ini = oReader.GetString("user_name_ini");
            oNewUser.user_name     = oReader.GetString("user_name");
            oNewUser.user_pass     = oReader.GetString("user_pass");
            oNewUser.user_type     = (EnumUserType)oReader.GetInt32("user_type");
            oNewUser.user_islogon  = oReader.GetBoolean("user_islogon");
            oNewUser.user_lock     = oReader.GetBoolean("user_lock");
            oNewUser.user_status   = (EnumUserStatus)oReader.GetInt32("user_status");
            oNewUser.OwnerName     = oReader.GetString("OwnerName");
            BusinessObject.Factory.SetObjectState(oNewUser, ObjectState.Saved);
        }
Пример #6
0
        private User Mapobject(DbDataReader dr)
        {
            User user = new User();

            user.userID       = NullHandler.GetString(dr["USER_ID"]);
            user.userName     = NullHandler.GetString(dr["USER_NAME"]);
            user.password     = NullHandler.GetString(dr["PASSWORD"]);
            user.creationDate = NullHandler.GetDateTime(dr["CREATION_DATE"]);
            user.roleType     = (RoleType)NullHandler.GetInt32(dr["ROLE_TYPE"]);
            user.active       = NullHandler.GetBoolean(dr["ACTIVE"]);

            return(user);
        }
Пример #7
0
        private void MapObject(ChartOfAcc oChartOfAcc, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oChartOfAcc, new ID(oReader.GetInt32("Coa_id")));

            oChartOfAcc.Coa_type = oReader.GetString("Coa_type");

            oChartOfAcc.Coa_parent_id = oReader.GetInt32("Coa_parent_id");

            oChartOfAcc.Coa_is_perent = oReader.GetBoolean("Coa_is_perent");

            oChartOfAcc.Coa_title = oReader.GetString("Coa_title");

            oChartOfAcc.Coa_level_code = oReader.GetString("Coa_level_code");

            oChartOfAcc.Coa_account_code = oReader.GetString("Coa_account_code");

            oChartOfAcc.Coa_legacy_code = oReader.GetString("Coa_legacy_code");

            oChartOfAcc.Coa_is_ledgerhead = oReader.GetBoolean("Coa_is_ledgerhead");

            BusinessObject.Factory.SetObjectState(oChartOfAcc, ObjectState.Saved);
        }
Пример #8
0
        private void MapObject(UserSecurity oUserSecurity, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oUserSecurity, new ID(oReader.GetInt32("USID")));

            oUserSecurity.user_id = oReader.GetInt32("user_id");

            oUserSecurity.MacAddress = oReader.GetString("MacAddress");

            oUserSecurity.IsAuthorise = oReader.GetBoolean("IsAuthorise");

            oUserSecurity.AuthoriseBy = oReader.GetInt32("AuthoriseBy");

            oUserSecurity.RequestDate = oReader.GetDateTime("RequestDate");

            oUserSecurity.AuthoriseDate = oReader.GetDateTime("AuthoriseDate");

            BusinessObject.Factory.SetObjectState(oUserSecurity, ObjectState.Saved);
        }
Пример #9
0
        private void MapObject(Party oParty, NullHandler oReader)
        {
            BusinessObject.Factory.SetID(oParty, new ID(oReader.GetInt32("PartyID")));

            oParty.PartyType = (EnumParty)oReader.GetInt32("PartyType");

            oParty.AccountCode = oReader.GetString("AccountCode");

            oParty.PartyName = oReader.GetString("PartyName");

            oParty.Address = oReader.GetString("Address");

            oParty.Mobile = oReader.GetString("Mobile");

            oParty.Phone = oReader.GetString("Phone");

            oParty.Email = oReader.GetString("Email");

            oParty.IsActive = oReader.GetBoolean("IsActive");

            BusinessObject.Factory.SetObjectState(oParty, ObjectState.Saved);
        }
Пример #10
0
    /// <summary>
    /// Binds a Dropdownlist Controls to a Collection
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="ddl"></param>
    /// <param name="entities"></param>
    /// <param name="displayField"></param>
    /// <param name="valueField"></param>
    //public static void BindDropDownList<T>(DropDownList ddl, IList<T> entities, String displayField, String valueField)
    //    where T : BaseEntity
    //{
    //    if (entities == null || entities.Count == 0)
    //    {
    //        if (ddl.Items.Count > 0)
    //            ddl.Items.Clear();
    //        ddl.DataSource = null;
    //        ddl.DataBind();
    //    }
    //    else
    //    {
    //        ddl.DataSource = entities;
    //        ddl.DataTextField = displayField;
    //        ddl.DataValueField = valueField;
    //        ddl.DataBind();
    //    }
    //    ddl.Items.Insert(0, new ListItem(String.Empty, String.Empty));
    //}
    /// <summary>
    /// Binds a Dropdownlist to a DataTable
    /// </summary>
    /// <param name="ddl"></param>
    /// <param name="dt"></param>
    /// <param name="displayField"></param>
    /// <param name="valueField"></param>
    //public static void BindDropDownList(DropDownList ddl, DataTable dt, String displayField, String valueField)
    //{

    //    if (dt == null || dt.Rows.Count <= 0)
    //    {
    //        if (ddl.Items.Count > 0)
    //            ddl.Items.Clear();
    //        ddl.DataSource = null;
    //        ddl.DataBind();
    //    }
    //    else
    //    {
    //        ddl.DataSource = dt.DefaultView;
    //        ddl.DataTextField = displayField;
    //        ddl.DataValueField = valueField;
    //        ddl.DataBind();
    //    }
    //    ddl.Items.Insert(0, new ListItem(String.Empty, String.Empty));
    //}
    /// <summary>
    /// Adds Client Side Confirmation Text to a Server Side Button Control according to the Validation Group
    /// </summary>
    /// <param name="btn"></param>
    /// <param name="message"></param>
    /// <param name="isSaveButton"></param>
    //public static void AddCorfirmation(Button btn, String message, bool isSaveButton)
    //{
    //    if (isSaveButton)
    //    {
    //        if (!btn.ValidationGroup.IsNullOrEmpty())
    //            btn.Attributes.Add("ValidationGroupName", btn.ValidationGroup);

    //        btn.Attributes.Add(AppConstants.CONFIRMATION_MSG_CUSTOM_ATTR, message);
    //        btn.Attributes["onclick"] = "return ShowSaveConfirmation(this);";
    //    }
    //    else
    //        btn.Attributes["onclick"] = String.Format("return confirm('{0}');", message);
    //}
    /// <summary>
    /// Creates a Uniques UserID from Organization Code and UserID
    /// </summary>
    /// <param name="adminSystemUser"></param>
    /// <returns></returns>
    //public static string GetUserID(App.Models.Admin.AdminSystemUser adminSystemUser)
    //{
    //    return String.Format("{0}{1}", adminSystemUser.OrgCode, adminSystemUser.UserID);
    //}

    //public static String GetDeleteConfirmation()
    //{
    //    return String.Format("onclick=\"return confirm('Sure to Delete?')\"");
    //}

    //public static String GetEditPermissionDeniedMessage()
    //{
    //    return String.Format("javascript:alert('{0}');javascript:void(0);", AppConstants.Message.EDIT_PERMISSION_DENIED);
    //}
    //public static String GetDeletePermissionDeniedMessage()
    //{
    //    return String.Format("javascript:alert('{0}');javascript:void(0);", AppConstants.Message.DELETE_PERMISSION_DENIED);
    //}

    /// <summary>
    /// Returns Formatted Data Returned from a Data Reader or a Data Table Cell
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    public static String FormatData(object data)
    {
        if (data.GetType() == typeof(String))
        {
            return(WebUtil.FormatText(NullHandler.GetString(data)));
        }
        else if (data.GetType() == typeof(DateTime))
        {
            return(NullHandler.GetDateTime(data).ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY));
        }
        else if (data.GetType() == typeof(decimal))
        {
            return(String.Format(AppConstants.ValueOf.DECIMAL_FORMAT, NullHandler.GetDecimal(data)));
        }
        else if (data.GetType() == typeof(bool))
        {
            return(NullHandler.GetBoolean(data) ? "Yes" : "No");
        }
        else
        {
            return(NullHandler.GetString(data));
        }
    }