コード例 #1
0
        public List <ClientCommissionCategoryCommon> GetCommissionCategoryList(string agentid)
        {
            string sql = "exec  sproc_client_commission_detail ";

            sql += " @flag='list'";
            sql += ", @agent_id=" + dao.FilterString(agentid);
            var dt = dao.ExecuteDataTable(sql);
            List <ClientCommissionCategoryCommon> list = new List <ClientCommissionCategoryCommon>();

            if (dt != null)
            {
                foreach (DataRow item in dt.Rows)
                {
                    var common = new ClientCommissionCategoryCommon
                    {
                        CategoryId   = item["category_id"].ToString(),
                        CategoryName = item["category_name"].ToString(),
                        CreatedBy    = item["created_by"].ToString(),
                        CreateDate   = item["created_local_date"].ToString(),
                        IsActive     = item["is_active"].ToString()
                                       //UpdatedBy = item["updated_by"].ToString()
                    };
                    list.Add(common);
                }
            }
            return(list);
        }
コード例 #2
0
        public JsonResult DisableCommissionCategory(string ID)
        {
            if (!string.IsNullOrEmpty(ID))
            {
                ClientCommissionCategoryCommon CCC = new ClientCommissionCategoryCommon();
                CCC.CategoryId = ID.DecryptParameter();
                CCC.IpAddress  = ApplicationUtilities.GetIP();
                CCC.ActionUser = Session["username"].ToString();
                if (string.IsNullOrEmpty(CCC.CategoryId))
                {
                    return(Json(new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid Category."
                    }));
                }
                CommonDbResponse dbresp = comm.block_unblockCategory(CCC, "N");

                if (dbresp.ErrorCode == 0)
                {
                    dbresp.Message = "Successfully Blocked Category";
                    dbresp.SetMessageInTempData(this);
                }
                return(Json(dbresp));
            }
            return(Json(new CommonDbResponse {
                ErrorCode = 1, Message = "Invalid Category."
            }));
        }
コード例 #3
0
        public CommonDbResponse block_unblockCategory(ClientCommissionCategoryCommon ccc, string status)
        {
            string sql = "exec sproc_client_commission_detail ";

            sql += "@flag='d'";
            sql += ",@comm_category_id=" + dao.FilterString(ccc.CategoryId);
            sql += ",@is_active=" + dao.FilterString(status);
            sql += ",@updated_by=" + dao.FilterString(ccc.ActionUser);
            return(dao.ParseCommonDbResponse(sql));
        }
コード例 #4
0
        public CommonDbResponse ManageCommissionCategory(ClientCommissionCategoryCommon CC)
        {
            string sql = "exec sproc_client_commission_detail ";

            sql += "@flag ='" + (string.IsNullOrEmpty(CC.CategoryId) ? "i" : "") + "' ";
            sql += ",@agent_id=" + dao.FilterString(CC.AgentId);
            sql += ", @comm_category_id=" + dao.FilterString(CC.CategoryId);
            sql += ", @comm_category_name=" + dao.FilterString(CC.CategoryName);
            sql += "," + (string.IsNullOrEmpty(CC.CategoryId) ? "@created_by" : "@updated_by") + "=" + dao.FilterString(CC.ActionUser);
            sql += "," + (string.IsNullOrEmpty(CC.CategoryId) ? "@created_ip" : "@updated_ip") + "=" + dao.FilterString(CC.IpAddress);


            return(dao.ParseCommonDbResponse(sql));
        }
コード例 #5
0
        public ClientCommissionCategoryCommon GetCommissionCategoryById(string Id)
        {
            string sql = "exec sproc_client_commission_detail ";

            sql += " @flag='lsbyid'";
            sql += ", @comm_category_id=" + dao.FilterString(Id);
            var dt = dao.ExecuteDataRow(sql);
            ClientCommissionCategoryCommon cc = new ClientCommissionCategoryCommon();

            if (dt != null)
            {
                cc.CategoryId   = dt["category_id"].ToString();
                cc.CategoryName = dt["category_name"].ToString();
            }
            return(cc);
        }
コード例 #6
0
        public ActionResult ManageCommissionCategory(ClientCommissionCategoryModel CCM)
        {
            if (ModelState.IsValid)
            {
                ClientCommissionCategoryCommon CCC = new ClientCommissionCategoryCommon();
                CCC.CategoryId   = CCM.CategoryId.DecryptParameter();
                CCC.CategoryName = CCM.CategoryName;
                CCC.IpAddress    = ApplicationUtilities.GetIP();
                CCC.AgentId      = ApplicationUtilities.GetSessionValue("agentid").ToString();

                CCC.ActionUser = Session["username"].ToString();
                CommonDbResponse dbresp = comm.ManageCommissionCategory(CCC);


                if (dbresp.Code == 0)
                {
                    this.ShowPopup((int)dbresp.Code, dbresp.Message);
                    return(RedirectToAction("Category"));
                }
            }
            this.ShowPopup(1, "Error");
            return(View());
        }
コード例 #7
0
 public CommonDbResponse block_unblockCategory(ClientCommissionCategoryCommon ccc, string status)
 {
     return(_repo.block_unblockCategory(ccc, status));
 }
コード例 #8
0
 public CommonDbResponse ManageCommissionCategory(ClientCommissionCategoryCommon CC)
 {
     return(_repo.ManageCommissionCategory(CC));
 }