Example #1
0
 private void MakeEmptyForm()
 {
     TxtLocation.Focus();
     if (!FlagAdd)
     {
         BtnSave.Visible = true;
     }
     BtnUpdate.Visible     = false;
     BtnDelete.Visible     = false;
     ddlCity.SelectedValue = "0";
     TxtLocation.Text      = string.Empty;
     TxtSearch.Text        = string.Empty;
     BindCombo();
     ReportGrid(StrCondition);
 }
        private void InitComponent()
        {
            try
            {
                TxtEventName   = FindViewById <EditText>(Resource.Id.eventname);
                IconStartDate  = FindViewById <TextView>(Resource.Id.StartIcondate);
                TxtStartDate   = FindViewById <EditText>(Resource.Id.StartDateTextview);
                TxtStartTime   = FindViewById <EditText>(Resource.Id.StartTimeTextview);
                IconEndDate    = FindViewById <TextView>(Resource.Id.EndIcondate);
                TxtEndDate     = FindViewById <EditText>(Resource.Id.EndDateTextview);
                TxtEndTime     = FindViewById <EditText>(Resource.Id.EndTimeTextview);
                IconLocation   = FindViewById <TextView>(Resource.Id.IconLocation);
                TxtLocation    = FindViewById <EditText>(Resource.Id.LocationTextview);
                TxtDescription = FindViewById <EditText>(Resource.Id.description);

                ImageEvent = FindViewById <ImageView>(Resource.Id.EventCover);
                BtnImage   = FindViewById <Button>(Resource.Id.btn_selectimage);

                TxtAdd = FindViewById <TextView>(Resource.Id.toolbar_title);

                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconStartDate, IonIconsFonts.Time);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconEndDate, IonIconsFonts.Time);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconLocation, IonIconsFonts.Pin);

                Methods.SetColorEditText(TxtEventName, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtStartTime, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtStartDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtEndDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtEndTime, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtLocation, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtDescription, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                TxtStartTime.SetOnClickListener(this);
                TxtEndTime.SetOnClickListener(this);
                TxtStartDate.SetOnClickListener(this);
                TxtEndDate.SetOnClickListener(this);
                TxtLocation.ClearFocus();

                PublisherAdView = FindViewById <PublisherAdView>(Resource.Id.multiple_ad_sizes_view);
                AdsGoogle.InitPublisherAdView(PublisherAdView);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #3
0
    protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try
        {
            switch (e.CommandName)
            {
            case ("Select"):
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                    DS = Obj_PR.GetLocationForEdit(Convert.ToInt32(e.CommandArgument), out StrError);
                    if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                    {
                        TxtLocation.Text      = DS.Tables[0].Rows[0]["LocationName"].ToString();
                        ddlCity.SelectedValue = DS.Tables[0].Rows[0]["CityId"].ToString();
                    }
                    else
                    {
                        MakeEmptyForm();
                    }
                    DS     = null;
                    Obj_PR = null;
                    if (!FlagEdit)
                    {
                        BtnUpdate.Visible = true;
                    }
                    BtnSave.Visible = false;
                    if (!FlagDel)
                    {
                        BtnDelete.Visible = true;
                    }
                    TxtLocation.Focus();
                }

                break;
            }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Example #4
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0;

        try
        {
            DS = Obj_PR.ChkDuplicate(TxtLocation.Text.Trim(), out StrError);
            if (DS.Tables[0].Rows.Count > 0)
            {
                obj_Comm.ShowPopUpMsg("Location Name Already Exist..!", this.Page);
                TxtLocation.Focus();
            }
            else
            {
                Entity_PR.LocationName = TxtLocation.Text.Trim();

                if (Convert.ToInt32(ddlCity.SelectedValue) > 0)
                {
                    Entity_PR.CityId = Convert.ToInt32(ddlCity.SelectedValue);
                }
                else
                {
                    obj_Comm.ShowPopUpMsg("Select City First..!", this.Page);
                    ddlCity.Focus();
                    return;
                }
                Entity_PR.LoginId   = Convert.ToInt32(Session["UserId"]);
                Entity_PR.LoginDate = DateTime.Now;
                InsertRow           = Obj_PR.InsertRecord(ref Entity_PR, out StrError);

                if (InsertRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
                    MakeEmptyForm();
                    Entity_PR = null;
                    obj_Comm  = null;
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Example #5
0
 private void LocLost(object sender, RoutedEventArgs e)
 {
     if (Validation(TxtLocation.Text.Trim()))
     {
         TxtLocation.MouseEnter -= LocTool;           // Removes handler
         TxtLocation.ToolTip     = null;              // Removes tooltip
         TxtLocation.ClearValue(BackgroundProperty);  // Resets background property to default
         TxtLocation.ClearValue(BorderBrushProperty); // Resets border property to default
     }
     else
     {
         TxtLocation.BorderBrush     = Brushes.Red;
         TxtLocation.BorderThickness = new Thickness(1);
         var c = Colors.Red;
         c.A = 20;
         TxtLocation.Background  = new SolidColorBrush(c);
         TxtLocation.MouseEnter += LocTool;
     }
 }
Example #6
0
        private void TxtLocation_TextChanged(object sender, EventArgs e)
        {
            string QueryRes     = "";
            int    NumberOfChar = TxtLocation.Text.Length - TxtLocation.SelectedText.Length;

            if (SearchKeyHit == true && FromTextChange == false)
            {
                string EnteredText = TxtLocation.Text;
                QueryRes = CommFunc.Fetch_DB_Value("distinct(Location)", "LocationFact", "Location like '"
                                                   + EnteredText + "%'");
                if (QueryRes != "")
                {
                    TxtLocation.Text = QueryRes;
                    TxtLocation.Select(NumberOfChar, TxtLocation.Text.Length - NumberOfChar);
                }
                FromTextChange = true;
            }
            else
            {
                FromTextChange = false;
            }
        }
Example #7
0
 private void GetEditRecord()
 {
     if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
     {
         TxtLocation.Text      = DS.Tables[0].Rows[0]["LocationName"].ToString();
         ddlCity.SelectedValue = DS.Tables[0].Rows[0]["CityId"].ToString();
     }
     else
     {
         MakeEmptyForm();
     }
     DS     = null;
     Obj_PR = null;
     if (!FlagEdit)
     {
         BtnUpdate.Visible = true;
     }
     BtnSave.Visible = false;
     if (!FlagDel)
     {
         BtnDelete.Visible = true;
     }
     TxtLocation.Focus();
 }