using Swift.DAL.BL.System.GeneralSettings; using Swift.DAL.SwiftDAL; using Swift.web.Library; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Swift.web.Remit.Administration.ReferralSetup { public partial class Manage : System.Web.UI.Page { private const string ViewFunctionId = "90400000"; private readonly StaticDataDao _obj = new StaticDataDao(); private readonly StaticDataDdl _sl = new StaticDataDdl(); protected void Page_Load(object sender, EventArgs e) { //Authenticate(); if (!IsPostBack) { GetStatic.SetActiveMenu(ViewFunctionId); PopulateDataById(); } } private void PopulateDataById() { string rewardType = GetStatic.ReadQueryString("Promotiontype", ""); DataRow dr = _obj.GetDetailById(GetStatic.GetUser(), rewardType); if (dr == null) return; promotionType.Text = dr["PromotionType"].ToString(); point.Text = dr["Points"].ToString(); ddlStatus.Text = dr["isActive"].ToString(); //PopulateDdl(dr); } protected void btnSumit_Click(object sender, EventArgs e) { Update(); } private void Update() { DbResult dbResult = _obj.UpdateByType(GetStatic.GetUser(), promotionType.Text, point.Text); ManageMessage(dbResult); } private void ManageMessage(DbResult dbResult) { GetStatic.SetMessage(dbResult); if (dbResult.ErrorCode == "0") { Response.Redirect("ReferPointSetup.aspx"); } else { GetStatic.PrintMessage(Page); } } protected void btnDelete_Click(object sender, EventArgs e) { _obj.DeleteByType(GetStatic.GetUser(), promotionType.Text); } } }