Ejemplo n.º 1
0
        private void Btndel_Click(object sender, EventArgs e)
        {
            int x = int.Parse(btndel.Tag.ToString());

            Db = new DbEventoo();
            Db.DeleteItemImages(x);
            //  ByteImages.RemoveAt(x);
            NotifyDataSetChanged();
        }
Ejemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var dlg = inflater.Inflate(Resource.Layout.DescriptionLonging, container, false);
            //
            LinearLayout lnaboutus = dlg.FindViewById <LinearLayout>(Resource.Id.desclonginglinearlayout);

            lnaboutus.SetBackgroundResource(Resource.Drawable.dialog_fragment_round);
            var font = Typeface.CreateFromAsset(ctx.Assets, "Estedad.ttf");



            desclongingtxtviewcaption = dlg.FindViewById <TextView>(Resource.Id.desclongingtxtviewcaption);



            desclongingtxtviewcaption.Typeface = font;



            desclongingedittextcost          = dlg.FindViewById <EditText>(Resource.Id.desclongingedittextcost);
            desclongingedittextcost.Typeface = font;

            desclongingbuttonenter          = dlg.FindViewById <Button>(Resource.Id.desclongingbuttonenter);
            desclongingbuttonenter.Typeface = font;
            desclongingbuttonenter.Click   += delegate {
                if (string.IsNullOrWhiteSpace(desclongingedittextcost.Text))
                {
                    //ثبت اطلاعات در دیتا بیس
                    DbEventoo Db = new DbEventoo();
                    // Db.RemoveAllLonging();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = Value, DescriptionLonging = desclongingedittextcost.Text
                    });

                    Dismiss();
                }
                else
                {
                    Toast.MakeText(Context, "پر کردن نوع رویداد اجباری میباشد", ToastLength.Long).Show();
                }
            };
            return(dlg);
        }
Ejemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var dlg  = inflater.Inflate(Resource.Layout.layoutconfirmmessage, container, false);
            var font = Typeface.CreateFromAsset(ctx.Assets, "Estedad.ttf");

            fragmentconfirmsmslinearlayoutmain = dlg.FindViewById <LinearLayout>(Resource.Id.fragmentconfirmsmslinearlayoutmain);
            fragmentconfirmsmslinearlayoutmain.SetBackgroundResource(Resource.Drawable.dialog_fragment_round);



            ////تایید
            //Button fragmentconfirmsmsbuttonok;
            ////ارسال مجدد
            //Button fragmentconfirmsmsbuttonresendsms;
            fragmentconfirmsmstxtviewheader          = dlg.FindViewById <TextView>(Resource.Id.fragmentconfirmsmstxtviewheader);
            fragmentconfirmsmstxtviewheader.Typeface = font;
            fragmentconfirmsmstxtviewtitle           = dlg.FindViewById <TextView>(Resource.Id.fragmentconfirmsmstxtviewtitle);
            fragmentconfirmsmstxtviewtitle.Typeface  = font;

            fragmentconfirmsmsedittextsms          = dlg.FindViewById <EditText>(Resource.Id.fragmentconfirmsmsedittextsms);
            fragmentconfirmsmsedittextsms.Typeface = font;

            fragmentconfirmsmsbuttonok          = dlg.FindViewById <Button>(Resource.Id.fragmentconfirmsmsbuttonok);
            fragmentconfirmsmsbuttonok.Typeface = font;
            DbEventoo DbConnection;

            DbConnection = new DbEventoo();
            var code = new Random().Next(10000, 88888);

            RabdomMessageSms rndmessage = new RabdomMessageSms
            {
                GetMessage = code.ToString()
            };

            DbConnection.RabdomMessageSmsInsert(rndmessage);
            var lastsms = DbConnection.RabdomMessageSmsGetAll().LastOrDefault();
            var tell    = DbConnection.NumberTelephonesGetAll().LastOrDefault();
            var getsms  = DbConnection.RabdomMessageSmsGetAll().LastOrDefault();

            using (HttpClient client = new HttpClient())
            {
                //client.BaseAddress = new Uri(WebAddress.MessageAddress);
                //client.DefaultRequestHeaders.Accept.Clear();
                //client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                //string json = JsonConvert.SerializeObject("", Formatting.Indented);
                //var httpContent = new StringContent(json);

                //PanelSms psms = new PanelSms()
                //{
                //    username = "",
                //    password = "",
                //    from = "",
                //    to = tell.GetTelephone,
                //    text = getsms.GetMessage

                //};

                //  HttpResponseMessage response = client.PostAsync("api/SendSMS/SendSMS", httpContent).Result;
                //if (response.IsSuccessStatusCode)
                //{
                //    response.EnsureSuccessStatusCode();
                //    var responseJsonString = response.Content.ReadAsStringAsync().Result;
                //    var result = JsonConvert.DeserializeObject(responseJsonString).ToString();
                //    var panel = JsonConvert.DeserializeObject<RetPanelSms>(result.ToString());
                //    if (panel.RetStatus == 1)
                //    {
                //        var toast = Toast.MakeText(this.Context, "ارسال پیام با موفقیت انجام شد", duration: ToastLength.Long);
                //        toast.SetGravity(GravityFlags.Center, 0, 0);
                //        toast.Show();

                //    }



                //}
            }
            fragmentconfirmsmsbuttonok.Text   = "تایید";
            fragmentconfirmsmsbuttonok.Click += delegate
            {
                if (fragmentconfirmsmsedittextsms.Text == getsms.GetMessage)
                {
                    var toast = Toast.MakeText(this.Context, "رویداد شما با موفقیت ثبت شدو در صف انتظار جهت تایید و انتشار قرار گرفت", duration: ToastLength.Long);
                    toast.SetGravity(GravityFlags.Center, 0, 0);
                    toast.Show();
                    DbConnection.ConfirmTellInsert(new ConfirmTell()
                    {
                        CinfitmMessage = 1, NumberTell = Convert.ToInt32(tell.GetTelephone)
                    });
                    Dismiss();
                }
                if (fragmentconfirmsmsedittextsms.Text != getsms.GetMessage)
                {
                    var toast = Toast.MakeText(this.Context, "کد وارد شده صحیح نمی باشد.کد صحیح را وارد نمایید", duration: ToastLength.Long);
                    toast.SetGravity(GravityFlags.Center, 0, 0);
                    toast.Show();
                    Dismiss();
                }
            };
            fragmentconfirmsmsbuttonresendsms        = dlg.FindViewById <Button>(Resource.Id.fragmentconfirmsmsbuttonresendsms);
            fragmentconfirmsmsedittextsms.Typeface   = font;
            fragmentconfirmsmsbuttonresendsms.Click += delegate
            {
                //ارسال مجدد sms
                var codes = new Random().Next(10000, 88888);

                //RabdomMessageSms retrndmessage = new RabdomMessageSms
                //{
                //    GetMessage = code.ToString()
                //};
                //DbConnection.RabdomMessageSmsInsert(retrndmessage);



                using (HttpClient client = new HttpClient())
                {
                    //client.BaseAddress = new Uri(WebAddress.MessageAddress);
                    //client.DefaultRequestHeaders.Accept.Clear();
                    //client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    //string json = JsonConvert.SerializeObject("", Formatting.Indented);
                    //var httpContent = new StringContent(json);

                    //PanelSms psms = new PanelSms
                    //{
                    //    username = "",
                    //    password = "",
                    //    from = "",
                    //    to = tell.GetTelephone,
                    //    text = getsms.GetMessage

                    //};

                    //HttpResponseMessage response = client.PostAsync("api/SendSMS/SendSMS", httpContent).Result;
                    //if (response.IsSuccessStatusCode)
                    //{
                    //    response.EnsureSuccessStatusCode();
                    //    var responseJsonString = response.Content.ReadAsStringAsync().Result;
                    //    var result = JsonConvert.DeserializeObject(responseJsonString).ToString();
                    //    var panel = JsonConvert.DeserializeObject<RetPanelSms>(result.ToString());
                    //    if (panel.RetStatus == 1)
                    //    {
                    //        var toast = Toast.MakeText(this.Context, "ارسال پیام با موفقیت انجام شد", duration: ToastLength.Long);
                    //        toast.SetGravity(GravityFlags.Center, 0, 0);
                    //        toast.Show();

                    //    }



                    //}
                };
            };
            return(dlg);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var dlg = inflater.Inflate(Resource.Layout.FragmnetLonging, container, false);
            //
            LinearLayout lnaboutus = dlg.FindViewById <LinearLayout>(Resource.Id.fragmentLonginglinearlayout);

            lnaboutus.SetBackgroundResource(Resource.Drawable.dialog_fragment_round);
            var font = Typeface.CreateFromAsset(ctx.Assets, "Estedad.ttf");

            //فروشگاه
            Longingchkstorelive       = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkstorelive);
            Longingchkstorelottery    = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkstorelottery);
            Longingchkstoregift       = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkstoregift);
            Longingchkstoreexhibition = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkstoreexhibition);
            Longingchkstoreopening    = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkstoreopening);
            //کلاس آموزشی
            Longingchkclasseductonfree       = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkclasseductonfree);
            Longingchkclasseductonlottery    = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkclasseductonlottery);
            Longingchkclasseductonother      = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkclasseductonother);
            Longingchkclasseductongift       = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkclasseductongift);
            Longingchkclasseductonexhibition = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkclasseductonexhibition);
            Longingchkclasseductonopening    = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkclasseductonopening);
            //اغذیه فروشی
            Longingchkfoodlive       = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkfoodlive);
            Longingchkfoodlottery    = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkfoodlottery);
            Longingchkfoodmajorlive  = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkfoodmajorlive);
            Longingchkfoodgift       = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkfoodgift);
            Longingchkfoodexhibition = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkfoodexhibition);
            Longingchkfoodopening    = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkfoodopening);

            if (TypeLonging.StartsWith("فروشگاه"))
            {
                //کلاس آموزشی
                Longingchkclasseductonfree.Visibility       = ViewStates.Gone;
                Longingchkclasseductonlottery.Visibility    = ViewStates.Gone;
                Longingchkclasseductonother.Visibility      = ViewStates.Gone;
                Longingchkclasseductongift.Visibility       = ViewStates.Gone;
                Longingchkclasseductonexhibition.Visibility = ViewStates.Gone;
                Longingchkclasseductonopening.Visibility    = ViewStates.Gone;
                //اغذیه فروشی
                Longingchkfoodlive.Visibility       = ViewStates.Gone;
                Longingchkfoodlottery.Visibility    = ViewStates.Gone;
                Longingchkfoodmajorlive.Visibility  = ViewStates.Gone;
                Longingchkfoodgift.Visibility       = ViewStates.Gone;
                Longingchkfoodexhibition.Visibility = ViewStates.Gone;
                Longingchkfoodopening.Visibility    = ViewStates.Gone;

                Longingchkstorelive.Click += delegate {
                    DbEventoo Db = new DbEventoo();
                    //   Db.RemoveAllLonging();
                    OnGetCaptionLonging.Invoke(this, new GetLonging("فروشگاه" + "-" + Longingchkstorelive.Text));

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "فروشگاه", DescriptionLonging = Longingchkstorelive.Text
                    });

                    Dismiss();
                };
                Longingchkstorelottery.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "فروشگاه", DescriptionLonging = Longingchkstorelottery.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("فروشگاه" + "-" + Longingchkstorelottery.Text));


                    Dismiss();
                };
                Longingchkstoregift.Click += delegate {
                    DbEventoo Db = new DbEventoo();
                    //   Db.RemoveAllLonging();
                    OnGetCaptionLonging.Invoke(this, new GetLonging("فروشگاه" + "-" + Longingchkstoregift.Text));
                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "فروشگاه", DescriptionLonging = Longingchkstoregift.Text
                    });

                    Dismiss();
                };
                Longingchkstoreexhibition.Click += delegate {
                    DbEventoo Db = new DbEventoo();
                    //   Db.RemoveAllLonging();
                    OnGetCaptionLonging.Invoke(this, new GetLonging("فروشگاه" + "-" + Longingchkstoreexhibition.Text));
                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "فروشگاه", DescriptionLonging = Longingchkstoreexhibition.Text
                    });

                    Dismiss();
                };
                Longingchkstoreopening.Click += delegate {
                    DbEventoo Db = new DbEventoo();
                    //    Db.RemoveAllLonging();
                    OnGetCaptionLonging.Invoke(this, new GetLonging("فروشگاه" + "-" + Longingchkstoreopening.Text));
                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "فروشگاه", DescriptionLonging = Longingchkstoreopening.Text
                    });

                    Dismiss();
                };
            }
            if (TypeLonging.StartsWith("کلاس"))
            {
                Longingchkstorelive.Visibility       = ViewStates.Gone;
                Longingchkstorelottery.Visibility    = ViewStates.Gone;
                Longingchkstoregift.Visibility       = ViewStates.Gone;
                Longingchkstoreexhibition.Visibility = ViewStates.Gone;
                Longingchkstoreopening.Visibility    = ViewStates.Gone;

                //اغذیه فروشی
                Longingchkfoodlive.Visibility       = ViewStates.Gone;
                Longingchkfoodlottery.Visibility    = ViewStates.Gone;
                Longingchkfoodmajorlive.Visibility  = ViewStates.Gone;
                Longingchkfoodgift.Visibility       = ViewStates.Gone;
                Longingchkfoodexhibition.Visibility = ViewStates.Gone;
                Longingchkfoodopening.Visibility    = ViewStates.Gone;

                Longingchkclasseductonfree.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "کلاس آموزشی", DescriptionLonging = Longingchkclasseductonfree.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("کلاس آموزشی" + "-" + Longingchkclasseductonfree.Text));
                    Dismiss();
                };;
                Longingchkclasseductonlottery.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "کلاس آموزشی", DescriptionLonging = Longingchkclasseductonlottery.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("کلاس آموزشی" + "-" + Longingchkclasseductonlottery.Text));
                    Dismiss();
                };
                Longingchkclasseductonother.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "کلاس آموزشی", DescriptionLonging = Longingchkclasseductonother.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("کلاس آموزشی" + "-" + Longingchkclasseductonother.Text));
                    Dismiss();
                };
                Longingchkclasseductongift.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "کلاس آموزشی", DescriptionLonging = Longingchkclasseductongift.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("کلاس آموزشی" + "-" + Longingchkclasseductongift.Text));
                    Dismiss();
                };
                Longingchkclasseductonexhibition.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "کلاس آموزشی", DescriptionLonging = Longingchkclasseductonexhibition.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("کلاس آموزشی" + "-" + Longingchkclasseductonexhibition.Text));
                    Dismiss();
                };
                Longingchkclasseductonopening.Click += delegate {
                    OnGetCaptionLonging.Invoke(this, new GetLonging("کلاس آموزشی" + "-" + Longingchkclasseductonopening.Text));
                    Dismiss();
                };
            }
            if (TypeLonging.StartsWith("اغذیه فروشی"))
            {
                //اغذیه فروشی
                Longingchkstorelive.Visibility       = ViewStates.Gone;
                Longingchkstorelottery.Visibility    = ViewStates.Gone;
                Longingchkstoregift.Visibility       = ViewStates.Gone;
                Longingchkstoreexhibition.Visibility = ViewStates.Gone;
                Longingchkstoreopening.Visibility    = ViewStates.Gone;

                //کلاس آموزشی
                Longingchkclasseductonfree.Visibility       = ViewStates.Gone;
                Longingchkclasseductonlottery.Visibility    = ViewStates.Gone;
                Longingchkclasseductonother.Visibility      = ViewStates.Gone;
                Longingchkclasseductongift.Visibility       = ViewStates.Gone;
                Longingchkclasseductonexhibition.Visibility = ViewStates.Gone;
                Longingchkclasseductonopening.Visibility    = ViewStates.Gone;

                //اغذیه فروشی
                Longingchkfoodlive.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "اغذیه فروشی", DescriptionLonging = Longingchkfoodlive.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("اغذیه فروشی" + "-" + Longingchkfoodlive.Text));
                    Dismiss();
                };
                Longingchkfoodlottery.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "اغذیه فروشی", DescriptionLonging = Longingchkfoodlottery.Text
                    });

                    OnGetCaptionLonging.Invoke(this, new GetLonging("اغذیه فروشی" + "-" + Longingchkfoodlottery.Text));
                    Dismiss();
                };
                Longingchkfoodmajorlive.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "اغذیه فروشی", DescriptionLonging = Longingchkfoodmajorlive.Text
                    });

                    OnGetCaptionLonging.Invoke(this, new GetLonging("اغذیه فروشی" + "-" + Longingchkfoodmajorlive.Text));
                    Dismiss();
                };
                Longingchkfoodgift.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "اغذیه فروشی", DescriptionLonging = Longingchkfoodgift.Text
                    });
                    OnGetCaptionLonging.Invoke(this, new GetLonging("اغذیه فروشی" + "-" + Longingchkfoodgift.Text));
                    Dismiss();
                };
                Longingchkfoodexhibition.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "اغذیه فروشی", DescriptionLonging = Longingchkfoodexhibition.Text
                    });

                    OnGetCaptionLonging.Invoke(this, new GetLonging("اغذیه فروشی" + "-" + Longingchkfoodexhibition.Text));
                    Dismiss();
                };
                Longingchkfoodopening.Click += delegate {
                    DbEventoo Db = new DbEventoo();

                    Db.LongingInsert(new Longing()
                    {
                        GetLonging = "اغذیه فروشی", DescriptionLonging = Longingchkfoodopening.Text
                    });

                    OnGetCaptionLonging.Invoke(this, new GetLonging("اغذیه فروشی" + "-" + Longingchkfoodopening.Text));
                    Dismiss();
                };
            }


            fragmentLongingtxtviewheader = dlg.FindViewById <TextView>(Resource.Id.fragmentLongingtxtviewheader);
            Longingchkdiscount           = dlg.FindViewById <CheckBox>(Resource.Id.Longingchkdiscount);


            fragmentLongingtxtviewheader.Text     = "جنبه رویداد";
            fragmentLongingtxtviewheader.Typeface = font;
            Longingchkdiscount.Typeface           = font;
            Longingchkdiscount.Click += delegate
            {
                //تخفیف
                Controller.Fragment.LongingDescription fdlg = new Fragment.LongingDescription(this.ctx, Longingchkdiscount.Text);
                fdlg.Show(this.FragmentManager, "ebrahimfragment122");

                Dismiss();
            };
            longingchkother          = dlg.FindViewById <CheckBox>(Resource.Id.longingchkother);
            longingchkother.Typeface = font;

            longingchkother.Click += delegate
            {
                //سایر

                Controller.Fragment.LongingDescription fdlg = new Fragment.LongingDescription(this.ctx, longingchkother.Text);
                fdlg.Show(this.FragmentManager, "ebrahimfragment122");
                //OnGetCaptionHealth.Invoke(this, new GetLonging(value + "-" + longingchkother.Text));
                Dismiss();
            };



            longingbuttoncancell          = dlg.FindViewById <Button>(Resource.Id.longingbuttoncancell);
            longingbuttoncancell.Typeface = font;
            longingbuttoncancell.Click   += delegate { Dismiss(); };
            return(dlg);
        }