Ejemplo n.º 1
0
    protected void btSave_Click(object sender, EventArgs e)
    {
        StaffClass obj = new StaffClass();

        obj.StaffName    = tbStaffName.Text;
        obj.StaffEmailID = tbEmailID.Text;

        Int64 mStateIDF = 0, mCityIDF = 0;

        Int64.TryParse(ddlState.SelectedValue, out mStateIDF);
        Int64.TryParse(ddlCity.SelectedValue, out mCityIDF);

        obj.StateIDF = mStateIDF;
        obj.CityIDF  = mCityIDF;
        if (!string.IsNullOrEmpty(tbDOB.Text))
        {
            obj.DOB = MyLogic.GetDateFormatProper(tbDOB.Text);
        }
        obj.Address  = tbAddress.Text;
        obj.MobileNo = tbMobileNo.Text;
        obj.UserName = tbUserName.Text;
        obj.Password = tbPassword.Text;
        obj.IsActive = true;
        MEMBERS.SQLReturnValue mRes;
        obj.Flag     = "EDIT";
        obj.StaffIDP = Int64.Parse(hfID.Value);
        mRes         = StaffClass.Insert_Update_Staff(obj);
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        BindData();
    }
    void MyLogic_AreSettingsValidIsTrue_WhenValuesAreSet()
    {
        var mockMySettings = Mock <IMySettings>();

        mockMySettings.Setup(m =>
                             m.GetSetting(It.IsAny < string())).Returns("something");
        var myLogic = new MyLogic();

        Assert(true, myLogic.AreSettingsValid(mySettings.Object));
    }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Podaj frazę:");
            var input = System.Console.ReadLine();
            var main  = new MyLogic <Word>("../../../ReSearcher.Console/Data/Items.json");
            var list  = main.SearchResult(input);

            foreach (var item in list)
            {
                System.Console.WriteLine(item.Key.Value + ":" + item.Score);
                System.Console.WriteLine();
            }
            System.Console.ReadLine();
        }
Ejemplo n.º 4
0
    protected void btSave_Click(object sender, EventArgs e)
    {
        AdvertiserClass obj = new AdvertiserClass();

        obj.AdvertiserName = tbAdvertiserName.Text;
        obj.EmailID        = tbEmailID.Text;

        Int64 mStateIDF = 0, mCityIDF = 0;

        Int64.TryParse(ddlState.SelectedValue, out mStateIDF);
        Int64.TryParse(ddlCity.SelectedValue, out mCityIDF);
        obj.StateIDF = mStateIDF;
        obj.CityIDF  = mCityIDF;
        obj.Address  = tbAddress.Text;
        obj.MobileNo = tbMobileNo.Text;
        obj.IsActive = cbIsActive.Checked;
        obj.UserName = tbUserName.Text;
        obj.Password = tbPassword.Text;
        obj.UserID   = 0;
        if (!string.IsNullOrEmpty(tbDOB.Text))
        {
            obj.DOB = MyLogic.GetDateFormatProper(tbDOB.Text);
        }

        MEMBERS.SQLReturnValue mRes;
        if (hfID.Value == string.Empty)
        {
            obj.Flag = "ADD";
            mRes     = AdvertiserClass.Insert_Update_Advertiser(obj);
        }
        else
        {
            obj.Flag          = "EDIT";
            obj.AdvertiserIDP = Int64.Parse(hfID.Value);
            mRes = AdvertiserClass.Insert_Update_Advertiser(obj);
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        ClearControls();
        BindData();
        pnC.Visible      = false;
        pnG.Visible      = true;
        btAddNew.Visible = true;
    }
    protected void btSave_Click(object sender, EventArgs e)
    {
        SetPlanInAdvertiserClass obj = new SetPlanInAdvertiserClass();

        Int64 mAdvertiserIDF = 0, mPlanIDF = 0;

        Int64.TryParse(ddlAdvertise.SelectedValue, out mAdvertiserIDF);
        Int64.TryParse(ddlAdvertisePlan.SelectedValue, out mPlanIDF);

        obj.AdvertiserIDF = mAdvertiserIDF;
        obj.PlanIDF       = mPlanIDF;

        if (!string.IsNullOrEmpty(tbPlanStartDate.Text))
        {
            obj.PlanStartDate = MyLogic.GetDateFormatProper(tbPlanStartDate.Text);
        }

        if (!string.IsNullOrEmpty(tbPlanEndDate.Text))
        {
            obj.PlanEndDate = MyLogic.GetDateFormatProper(tbPlanEndDate.Text);
        }
        MEMBERS.SQLReturnValue mRes;
        if (hfID.Value == string.Empty)
        {
            obj.Flag = "ADD";
            mRes     = SetPlanInAdvertiserClass.Insert_Update_Advertiser_Plan(obj);
        }
        else
        {
            obj.Flag = "EDIT";
            obj.AdvertiserPlanIDP = Int64.Parse(hfID.Value);
            mRes = SetPlanInAdvertiserClass.Insert_Update_Advertiser_Plan(obj);
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        ClearControls();
        BindData();
        pnC.Visible      = false;
        pnG.Visible      = true;
        btAddNew.Visible = true;
    }
Ejemplo n.º 6
0
    protected void btSave_Click(object sender, EventArgs e)
    {
        KnowYourRuleClass obj = new KnowYourRuleClass();

        obj.Rules = tbRuleName.Text;
        if (!string.IsNullOrEmpty(tbDisplayFromDate.Text))
        {
            obj.DisplayDateFrom = MyLogic.GetDateFormatProper(tbDisplayFromDate.Text);
        }

        if (!string.IsNullOrEmpty(tbDisplayToDate.Text))
        {
            obj.DisplayDateTo = MyLogic.GetDateFormatProper(tbDisplayToDate.Text);
        }
        obj.IsActive = cbIsActive.Checked;
        obj.IsShow   = cbIsShow.Checked;

        MEMBERS.SQLReturnValue mRes;
        if (hfID.Value == string.Empty)
        {
            obj.Flag = "ADD";
            mRes     = KnowYourRuleClass.Insert_Update_KnowYourRule(obj);
        }
        else
        {
            obj.Flag    = "EDIT";
            obj.RuleIDP = Int64.Parse(hfID.Value);
            mRes        = KnowYourRuleClass.Insert_Update_KnowYourRule(obj);
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        ClearControls();
        BindData();
        pnC.Visible      = false;
        pnG.Visible      = true;
        btAddNew.Visible = true;
    }
    protected void btSave_Click(object sender, EventArgs e)
    {
        AdminProfileClass obj = new AdminProfileClass();

        obj.FirstName = tbFirstName.Text;
        obj.LastName  = tbLastName.Text;
        obj.EmailID   = tbEmailID.Text;

        if (!string.IsNullOrEmpty(tbDOB.Text))
        {
            obj.DOB = MyLogic.GetDateFormatProper(tbDOB.Text);
        }

        obj.Address  = tbAddress.Text;
        obj.MobileNo = tbMobileNo.Text;

        obj.EmailID = tbEmailID.Text;

        string PathDir = Server.MapPath("~/SiteLogo/");

        if (fSiteLogo.HasFile)
        {
            string ImageName = fSiteLogo.PostedFile.FileName;
            if (hfID.Value == string.Empty)
            {
                fSiteLogo.SaveAs(PathDir + "\\" + ImageName);
            }
            else
            {
                if (File.Exists(Path.Combine(PathDir, Session["SiteLogo"].ToString())))
                {
                    File.Delete(Path.Combine(PathDir, Session["SiteLogo"].ToString()));
                    fSiteLogo.SaveAs(PathDir + "\\" + ImageName);
                }
            }
            obj.SiteLogo = ImageName;
        }
        else
        {
            obj.SiteLogo = Session["SiteLogo"].ToString();
        }

        obj.SiteTextLogo = tbSiteTextLogo.Text;

        if (rActiveSiteLog.Checked)
        {
            obj.IsLogoActive = true;
            obj.IsTextActive = false;
        }
        else if (rActiveSiteText.Checked)
        {
            obj.IsLogoActive = false;
            obj.IsTextActive = true;
        }
        else
        {
            if (fSiteLogo.HasFile)
            {
                obj.IsLogoActive = true;
                obj.IsTextActive = false;
            }
            else if (!string.IsNullOrEmpty(tbSiteTextLogo.Text))
            {
                obj.IsLogoActive = false;
                obj.IsTextActive = true;
            }
        }

        MEMBERS.SQLReturnValue mRes;
        if (hfID.Value == string.Empty)
        {
            obj.Flag = "ADD";
            mRes     = AdminProfileClass.Insert_Update_AdminProfile(obj);
        }
        else
        {
            obj.Flag            = "EDIT";
            obj.AdminProfileIDP = Int64.Parse(hfID.Value);
            mRes = AdminProfileClass.Insert_Update_AdminProfile(obj);
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "noti", "setMessage('<b>" + mRes.MessageFromSQL + "</b>',1);", true);
        BindData();
    }
Ejemplo n.º 8
0
 private MySingleton()
 {
     Implementation = new MyLogic();
 }