コード例 #1
0
        public ResponseModel GetGraphCountData([FromBody] GraphCountDataRequest GraphCountData)
        {
            ResponseModel objResponseModel = new ResponseModel();
            int           StatusCode       = 0;
            string        statusMessage    = "";
            GraphModal    graphmodalObj    = new GraphModal();

            try
            {
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromToken(_radisCacheServerAddress, SecurityService.DecryptStringAES(token));

                GraphCaller graphcaller = new GraphCaller();

                graphmodalObj = graphcaller.GetGraphCountData(new GraphService(_connectionSting), authenticate.TenantId, authenticate.UserMasterID, GraphCountData);
                StatusCode    = (int)EnumMaster.StatusCode.Success;
                statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)StatusCode);

                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = StatusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = graphmodalObj;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }
コード例 #2
0
        /// <summary>
        /// Get GraphCountData
        /// </summary>
        /// <param name="TenantID"></param>
        /// <param name="UserID"></param>
        /// <param name="UserIds"></param>
        /// <param name="BrandIDs"></param>
        /// <returns></returns>
        public GraphModal GetGraphCountData(int TenantID, int UserID, GraphCountDataRequest GraphCountData)
        {
            DataSet    ds  = new DataSet();
            GraphModal obj = new GraphModal();

            try
            {
                conn.Open();
                MySqlCommand cmd = new MySqlCommand("Sp_GetGraphCountData", conn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@_TenantID", TenantID);
                cmd.Parameters.AddWithValue("@_UserID", UserID);
                cmd.Parameters.AddWithValue("@UserIds", GraphCountData.UserIds);
                cmd.Parameters.AddWithValue("@BrandIDs", GraphCountData.BrandIDs);
                cmd.Parameters.AddWithValue("@DateFrom", GraphCountData.DateFrom);
                cmd.Parameters.AddWithValue("@DateEnd", GraphCountData.DateEnd);
                MySqlDataAdapter da = new MySqlDataAdapter
                {
                    SelectCommand = cmd
                };
                da.Fill(ds);
                if (ds != null && ds.Tables[0] != null)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        obj = new GraphModal
                        {
                            TaskOpen      = Convert.ToInt32(ds.Tables[0].Rows[0]["TaskOpen"]),
                            TaskOverDue   = Convert.ToInt32(ds.Tables[0].Rows[0]["TaskOverDue"]),
                            TaskDueToday  = Convert.ToInt32(ds.Tables[0].Rows[0]["TaskDueToday"]),
                            CampaingnOpen = Convert.ToInt32(ds.Tables[0].Rows[0]["CampaingOpen"]),
                            ClaimOpen     = Convert.ToInt32(ds.Tables[0].Rows[0]["ClaimOpen"]),
                            ClaimDueToday = Convert.ToInt32(ds.Tables[0].Rows[0]["ClaimDueToday"]),
                            ClaimOverDue  = Convert.ToInt32(ds.Tables[0].Rows[0]["ClaimOverDue"])
                        };
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }

            return(obj);
        }