Пример #1
0
        ///<summary>
        ///Get conditions by object with Multi-TokenType.
        ///</summary>
        public static ParameterCollection GetConditionsByObject(DO_APIS_Info.UO_APIS_Info parameterObj, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_APIS_Info.Columns, TokenTypes> extTokens)
        {
            ParameterCollection objectConditions = new ParameterCollection();
            TokenTypes          tt = tokenTypes;
            ParameterType       pt = isAnd ? ParameterType.And : ParameterType.Or;

            if (parameterObj.Id != 0 || (extTokens != null && extTokens.ContainsKey(DO_APIS_Info.Columns.Id)))
            {
                objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_APIS_Info.Columns.Id, extTokens), DO_APIS_Info.Columns.Id, parameterObj.Id);
            }
            if (!string.IsNullOrEmpty(parameterObj.Country))
            {
                objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_APIS_Info.Columns.Country, extTokens), DO_APIS_Info.Columns.Country, parameterObj.Country);
            }
            if (!string.IsNullOrEmpty(parameterObj.Airlines))
            {
                objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_APIS_Info.Columns.Airlines, extTokens), DO_APIS_Info.Columns.Airlines, parameterObj.Airlines);
            }
            if (!string.IsNullOrEmpty(parameterObj.CreateBy))
            {
                objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_APIS_Info.Columns.CreateBy, extTokens), DO_APIS_Info.Columns.CreateBy, parameterObj.CreateBy);
            }
            if (!string.IsNullOrEmpty(parameterObj.UpdateBy))
            {
                objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_APIS_Info.Columns.UpdateBy, extTokens), DO_APIS_Info.Columns.UpdateBy, parameterObj.UpdateBy);
            }
            return(objectConditions);
        }
Пример #2
0
    private void GetList()
    {
        Database_Output_APIS_Info_Result c = (Database_Output_APIS_Info_Result)Page.LoadControl("APIS_Info_Result.ascx");

        DO_APIS_Info.UO_APIS_Info l = new DO_APIS_Info.UO_APIS_Info();
        GetTogether.Web.WebHelper.SetValues <DO_APIS_Info.UO_APIS_Info>(l, "APIS_Info_");
        if (string.IsNullOrEmpty(Sort))
        {
            Sort = DO_APIS_Info.Columns.Id.ToString();
        }
        PagingResult <DO_APIS_Info.UO_APIS_Info, DO_APIS_Info.UOList_APIS_Info> resultPaging = BO_APIS_Info.GetPagingList(l, PageIndex, PageSize, Sort, IsAsc);

        c.JsFunction = "APIS_Info_Search";
        c.SetData <DO_APIS_Info.UO_APIS_Info, DO_APIS_Info.UOList_APIS_Info>(resultPaging.Result);
        c.Total     = resultPaging.Total;
        c.Sort      = Sort;
        c.PageIndex = PageIndex;
        c.PageSize  = PageSize;
        c.IsAsc     = IsAsc;
        this.Controls.Add(c);
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Int32 id = 0;

        if (!string.IsNullOrEmpty(Request["id"]))
        {
            id = Convert.ToInt32(Request["id"]);
        }
        if (id > 0)
        {
            UO = BO_APIS_Info.GetObjectById(id);
        }
        if (UO == null)
        {
            UO = new DO_APIS_Info.UO_APIS_Info();
        }

        if (Request.Form.Keys.Count > 0)
        {
            GetTogether.Web.WebHelper.SetValues <DO_APIS_Info.UO_APIS_Info>(UO, "APIS_Info_");
            if (id > 0)
            {
                //Pending
                UO["UpdateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd");
                UO["UpdateBy"] = string.Concat("WS-", Request.UserHostAddress);
                UO.Update(BO_APIS_Info.GetConditionsById(id));
            }
            else
            {
                //Pending
                UO["CreateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd");
                UO["CreateBy"] = string.Concat("WS-", Request.UserHostAddress);
                UO.Insert();
            }
            Response.Redirect("APIS_Info.aspx");
        }
    }
Пример #4
0
 ///<summary>
 ///Update object by primary key string(with transation).
 ///</summary>
 public static bool UpdateObjectByPrimaryKeyString(DO_APIS_Info.UO_APIS_Info obj, string primaryKeyString, IDbConnection connection, IDbTransaction transaction)
 {
     return(obj.Update(connection, transaction, GetConditionsByPrimaryKeyString(primaryKeyString)) > 0);
 }
Пример #5
0
 ///<summary>
 ///Update object by primary key string.
 ///</summary>
 public static bool UpdateObjectByPrimaryKeyString(DO_APIS_Info.UO_APIS_Info obj, string primaryKeyString)
 {
     return(obj.Update(GetConditionsByPrimaryKeyString(primaryKeyString)) > 0);
 }
Пример #6
0
 ///<summary>
 ///Update object by primary key(with transation).
 ///</summary>
 public static bool UpdateObject(DO_APIS_Info.UO_APIS_Info obj, System.Int32 Id, IDbConnection connection, IDbTransaction transaction)
 {
     return(obj.Update(connection, transaction, GetConditionsByPrimaryKey(Id)) > 0);
 }
Пример #7
0
 ///<summary>
 ///Update object by primary key.
 ///</summary>
 public static bool UpdateObject(DO_APIS_Info.UO_APIS_Info obj, System.Int32 Id)
 {
     return(obj.Update(GetConditionsByPrimaryKey(Id)) > 0);
 }
Пример #8
0
 ///<summary>
 ///Get paging list.
 ///</summary>
 public static PagingResult <DO_APIS_Info.UO_APIS_Info, DO_APIS_Info.UOList_APIS_Info> GetPagingList(DO_APIS_Info.UO_APIS_Info parameterObj, int pageNumber, int pageSize, string sortBy, bool isAsc)
 {
     return(parameterObj.GetPagingList(GetConditionsByObject(parameterObj, true, TokenTypes.Like, null), pageNumber, pageSize, sortBy, isAsc));
 }
Пример #9
0
 ///<summary>
 ///Get paging list.
 ///</summary>
 public static PagingResult <DO_APIS_Info.UO_APIS_Info, DO_APIS_Info.UOList_APIS_Info> GetPagingList(DO_APIS_Info.UO_APIS_Info parameterObj, int pageNumber, int pageSize, string sortBy, bool isAsc, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_APIS_Info.Columns, TokenTypes> extTokens)
 {
     return(parameterObj.GetPagingList(GetConditionsByObject(parameterObj, isAnd, tokenTypes, extTokens), pageNumber, pageSize, sortBy, isAsc));
 }
Пример #10
0
 ///<summary>
 ///Get list by object.
 ///</summary>
 public static DO_APIS_Info.UOList_APIS_Info GetList(DO_APIS_Info.UO_APIS_Info parameterObj)
 {
     return(GetList(parameterObj, true, TokenTypes.Equal, null));
 }
Пример #11
0
 ///<summary>
 ///Get list by object.
 ///</summary>
 public static DO_APIS_Info.UOList_APIS_Info GetList(DO_APIS_Info.UO_APIS_Info parameterObj, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_APIS_Info.Columns, TokenTypes> extTokens)
 {
     return(parameterObj.GetList(GetConditionsByObject(parameterObj, isAnd, tokenTypes, extTokens)));
 }
Пример #12
0
        ///<summary>
        ///Get records count.
        ///</summary>
        public static int GetRecordsCount(DO_APIS_Info.UO_APIS_Info parameterObj, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_APIS_Info.Columns, TokenTypes> extTokens)
        {
            DO_APIS_Info da = new DO_APIS_Info();

            return(da.GetRecordsCount(GetConditionsByObject(parameterObj, isAnd, tokenTypes, extTokens)));
        }
Пример #13
0
 ///<summary>
 ///Get records count.
 ///</summary>
 public static int GetRecordsCount(DO_APIS_Info.UO_APIS_Info parameterObj)
 {
     return(GetRecordsCount(parameterObj, true, TokenTypes.Equal, null));
 }