Inheritance: System.Web.UI.Page
コード例 #1
0
        // GET: Home
        public ActionResult Index()
        {
            home model = new home();
            bool x;

            x = (null == Request.Cookies["userName"]);


            if (x)
            {
                model.login = false;
            }
            else
            {
                model.login = true;
            }

            if (model.login)
            {
                return(View(model));
            }

            else
            {
                return(View(model));
            }
        }
コード例 #2
0
ファイル: LogIn.cs プロジェクト: Vedya/SPY-Bullion
        private void btnlogin_Click(object sender, EventArgs e)
        {
            connection = db.getConnection();
            if (connection != null)
            {
                command = new MySqlCommand("select * from user_reg where userid='" + textBox1.Text + "'and password='******'", connection);
                dr = command.ExecuteReader();
                if (dr.HasRows)
                {
                    dr.Read();
                    role = dr.GetString(3);
                    if (textBox1.Text == dr.GetString(0) && textBox2.Text == dr.GetString(2))
                    {
                        user = textBox1.Text;
                        home h = new home();
                        h.Show();
                        this.Hide();

                    }
                    else
                    {
                        textBox1.Text = "";
                        textBox2.Text = "";
                        MessageBox.Show("Invalid user name or password");
                    }
                }
                else
                {
                    textBox1.Text = "";
                    textBox2.Text = "";
                    MessageBox.Show("Invalid user name or password");
                }
            }
        }
コード例 #3
0
    private void main_Load(object sender, EventArgs e)
    {
        Form home = new home();

        home.MdiParent   = this;
        home.WindowState = FormWindowState.Maximized;
        home.Show();
    }
コード例 #4
0
        public DetalheImovel(int id_imovel, home inicio)
        {
            InitializeComponent();
            this.MaximizeBox = false;

            this.inicio    = inicio;
            this.id_imovel = id_imovel;
        }
コード例 #5
0
ファイル: huqController.cs プロジェクト: HKSam/Web_insurance
        // GET: huq
        public ActionResult Index()
        {
            var name = new home {
                name = Session["name"].ToString()
            };

            return(View(name));
        }
コード例 #6
0
        public VerFontesDeRenda(bool locatario, home inicio)
        {
            InitializeComponent();
            this.MaximizeBox = false;

            this.inicio    = inicio;
            this.locatario = locatario;
        }
コード例 #7
0
ファイル: selectBook.cs プロジェクト: aftadizca/Perpustakaan
 public bookSelect(home f, string idPeminjam, string idtransaksi)
 {
     this._home = f;
     InitializeComponent();
     this.idUser      = idPeminjam;
     this.idTransaksi = idtransaksi;
     loadDaftarBukuFilter("");
 }
コード例 #8
0
        private void NavigateHome(object sender, RoutedEventArgs e)
        {
            home homePage = new home();

            //NavigationAnimation fadeDirection = NavigationAnimation.FadeToLeft;
            //if (CurrentPageTag == "home")
            //    fadeDirection = NavigationAnimation.FadeToRight;

            App.MainWindow.AnimatedNavigate(App.MainWindow.DocumentPageFrame, homePage, NavigationAnimation.FadeToRight);
        }
コード例 #9
0
ファイル: Citizen.aspx.cs プロジェクト: gonick/NOCApp
    protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        (ListView1.FindControl("DataPager1") as DataPager).SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
        home    obj  = new home();
        DataSet dset = obj.listOFApp(TextBoxFrom.Text, TextBoxTo.Text);

        //GridView1.DataSource = dset;
        //GridView1.DataBind();
        ListView1.DataSource = dset;
        ListView1.DataBind();
    }
コード例 #10
0
    protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        (ListView1.FindControl("DataPager1") as DataPager).SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
        home    obj  = new home();
        DataSet dset = obj.NoOfNOCnotGiven(Convert.ToInt32(DropDownListDept.SelectedValue), TextBoxFrom.Text, TextBoxTo.Text);

        //GridView1.DataSource = dset;
        //GridView1.DataBind();
        ListView1.DataSource = dset;
        ListView1.DataBind();
    }
コード例 #11
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            home newMDIChild = new home();

            // Set the Parent Form of the Child window.
            newMDIChild.MdiParent = this;
            // Display the new form.
            newMDIChild.Show();
            newMDIChild.Dock = DockStyle.Fill;
        }
コード例 #12
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View rootView = inflater.Inflate(Resource.Layout.fragment_home, container, false);

            mHome          = new home();
            mRecyclerView  = rootView.FindViewById <RecyclerView>(Resource.Id.rvHome);
            mLayoutManager = new LinearLayoutManager(rootView.Context);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mHomeAdapter            = new HomeAdapter(mHome);
            mHomeAdapter.itemClick += MAdapter_ItemClick;
            mRecyclerView.SetAdapter(mHomeAdapter);

            return(rootView);
        }
コード例 #13
0
        //   private void btnsave_Click(object sender, RoutedEventArgs e)
        //{
        //    if (error != 0)
        //    {
        //        pop1.IsOpen = true;
        //    }
        //    else
        //    {
        //        if (rbmaintance.IsChecked == true)
        //        {
        //            maintenance = "1";
        //        }
        //        else maintenance = "0";
        //        if (rbmanagement.IsChecked == true)
        //        {
        //            management = "1";
        //        }
        //        else management = "0";

        //        blockroom br = new blockroom();

        //        br.ROOM_NO = txtroomno.Text;
        //        br.ROOM_TYPE = txtroomtype.Text;
        //        br.FROM_DATE = dpfromdate.Text;
        //        br.TO_DATE = dptodate.Text;
        //        br.MAINTANCE = maintenance.ToString();
        //        br.MANAGEMENT = management.ToString();
        //        br.REASON = txtreason.Text;
        //        //11/15/2017
        //        //br.USER_NAME = login.u;
        //        br.INSERT_BY = login.u;
        //        br.INSERT_DATE = DateTime.Today;
        //        //
        //        br.Insert();
        //        MessageBox.Show("inserted sucessfully");
        //        clear();

        //        disable();

        //        btnblock.IsEnabled = true;
        //        btnrelease.IsEnabled = true;
        //        btnsave.IsEnabled = false;

        //        this.NavigationService.Refresh();

        //        btnblock.Background = new SolidColorBrush(Color.FromRgb(53, 71, 102));
        //        btnrelease.Background = new SolidColorBrush(Color.FromRgb(53, 71, 102));
        //    }
        //}
        //public async Task<string> delay()
        //{
        //    clear();

        //    btnblock.IsEnabled = false;
        //    btnrelease.IsEnabled = false;
        //    btnsave.IsEnabled = false;
        //    await Task.Delay(900000);//asynchronously it is updating the color in room master after the given period of time.
        //    return "Finished";
        //}
        private void btnrelease_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                home h = new home();

                br.ROOM_NO = txtroomno.Text;
                enable();

                string St = null;

                if (rbmaintance1.IsChecked == true)
                {
                    St = "Green";
                }
                else
                {
                    St = "Blue";
                }
                Button btn = new Button();
                btn.Content = txtroomno.Text;
                br.ROOM_NO  = txtroomno.Text;
                ER.SET_COLOR(St, btn);

                br.ColorUpdate(St);

                //string result = await delay();


                //string S = "Green";
                //Button bt = new Button();
                //bt.Content = txtroomno.Text;

                //br.ROOM_NO = txtroomno.Text;

                //ER.SET_COLOR(S, bt);

                //br.ColorUpdate(S);

                clear();
                h.t.Start();

                btnrelease.Background = new SolidColorBrush(Colors.Orange);
                btnblock.Background   = new SolidColorBrush(Color.FromRgb(53, 71, 102));
            }
            catch (Exception) { }
        }
コード例 #14
0
    protected void ButtonShow_Click(object sender, EventArgs e)
    {
        home obj = new home();

        LabelNOCgiven.Text = "NOC given : " + obj.NoOfNOCgiven(Convert.ToInt32(DropDownListDept.SelectedValue), TextBoxFrom.Text, TextBoxTo.Text);

        DataSet dset = obj.NoOfNOCnotGiven(Convert.ToInt32(DropDownListDept.SelectedValue), TextBoxFrom.Text, TextBoxTo.Text);

        LabelNOCgiven.Text  += "&nbsp;&nbsp;&nbsp;&nbsp; Pending NOC: " + dset.Tables[0].Rows.Count;
        ListView1.DataSource = dset;
        ListView1.DataBind();
        if (dset.Tables[0].Rows.Count > 0)
        {
            LabelList.Text      = "List of pending NOC's";
            LabelList.ForeColor = System.Drawing.Color.Red;
            LabelList.Font.Size = 16;
        }
    }
コード例 #15
0
ファイル: LoginPage.cs プロジェクト: aftadizca/Perpustakaan
 private void login_Click(object sender, EventArgs e)
 {
     using (perpustakaanEntities db = new perpustakaanEntities())
     {
         var passx  = hashPass(pass.Text);
         var result = db.logins.Where(i => i.username == "admin" & i.password == passx).ToList();
         if (result.Count > 0)
         {
             home _home = new home();
             _home.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Password Salah!");
         }
     }
 }
コード例 #16
0
ファイル: Default.aspx.cs プロジェクト: gonick/NOCApp
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBoxFeedback.Text.Trim() != "" && TextBoxFeedback.Text.Trim() != null)
        {
            home obj = new home();
            obj.Feedback = TextBoxFeedback.Text.Trim();
            bool result = obj.insertFeedback();
            if (result)
            {
                UpdatePanel2.UpdateMode = UpdatePanelUpdateMode.Conditional;
                UpdatePanel2.Update();
                UpdatePanel2.DataBind();
                TextBoxFeedback.Text = null;
            }
        }
        string a = "alert('Thank you for your feedback!');";

        ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", a, true);
    }
コード例 #17
0
        //public IEnumerable<Register> Get()
        //{
        //    List<Register> regList;
        //    using (var context = new RegistrationDBEntities())
        //    {
        //        regList = context.Registers.ToList();

        /*
         *
         *
         */
        //    }
        //    return regList;

        //}

        public string Post(HomeModel homeModel)
        {
            int id;

            try
            {
                home hmeEF = new home()
                {
                    firstName        = homeModel.firstName,
                    Mobile           = homeModel.mobile,
                    Remarks          = homeModel.remarks,
                    Email            = homeModel.email,
                    locDubaiBusines  = homeModel.locDubaiBusiness,
                    locDubaiSilicon  = homeModel.locDubaiSilicon,
                    Budget400K700K   = homeModel.budget400K700K,
                    Budget700K1000K  = homeModel.budget700K1000K,
                    Budget1000K1250K = homeModel.budget1000K1250K,
                    Budget1250K1500K = homeModel.budget1250K1500K,
                    Studio           = homeModel.studio,
                    OneBed           = homeModel.oneBed,
                    TwoBed           = homeModel.twoBed,
                    Retail           = homeModel.retail,
                    Immed            = homeModel.immed,
                    Months3to6       = homeModel.months3to6,
                    Months6to12      = homeModel.months6to12,
                    Months12to18     = homeModel.months12to18
                };
                // will save data here in database;
                using (BGEnqiryEntities context = new BGEnqiryEntities())
                {
                    context.homes.Add(hmeEF);
                    context.SaveChanges();

                    id = hmeEF.Id;
                }
                return("Your Reference Number is: " + id);
            }
            catch (Exception ex)
            {
                return("Error " + -1 + ex.Message);
            }
        }
コード例 #18
0
ファイル: Citizen.aspx.cs プロジェクト: gonick/NOCApp
    protected void ButtonShow_Click(object sender, EventArgs e)
    {
        try
        {
            home obj = new home();
            //DataSet dset = obj.listOFApp(TextBoxFrom.Text, TextBoxTo.Text);
            ////GridView1.DataSource = dset;
            ////GridView1.DataBind();
            //ListView1.DataSource = dset;
            //ListView1.DataBind();
            overview();

            appReceived.Text = "Total Applications Received : " + dsetOverall.Tables[1].Rows.Count.ToString();
        }
        catch (Exception ex)
        {
            writeException obj = new writeException();
            obj.WriteExceptionToFile(ex, "Citizen.aspx.cs-ButtonShow_Click");
        }
    }
コード例 #19
0
ファイル: homeController.cs プロジェクト: HKSam/Web_insurance
        // GET: home
        public ActionResult Index()
        {
            username = Session["name"].ToString();
            var name = new home {
                name = Session["name"].ToString()
            };

            DateTime.Now.Month.ToString();
            MydataDataContext datas = new MydataDataContext();
            var pass = from r in datas.data
                       where (r.mouth == DateTime.Now.Month.ToString()) && (r.name == Session["name"].ToString())
                       select r;

            ViewBag.home = pass;
            var datad = from s in datas.data
                        where s.name == Session["name"].ToString()
                        select s;

            ViewBag.data = datad;
            return(View(name));
        }
コード例 #20
0
        private void DataBaseButton_Click(object sender, EventArgs e)
        {
            home home = new home();

            if (jezyk_pol == false)
            {
                home.lang = 1;
                home.comboBox1.Items[0]     = "Link Budget";
                home.comboBox1.Items[1]     = "Materials";
                home.comboBox1.Items[2]     = "Antennas";
                home.comboBox1.Items[3]     = "Devices";
                home.comboBox1.Items[4]     = "Cables";
                home.comboBox1.Items[5]     = "Connectors";
                home.comboBox1.SelectedItem = "Antennas";
            }
            else
            {
                home.lang = 0; home.comboBox1.SelectedItem = "Anteny";
            }
            home.ShowDialog();
        }
コード例 #21
0
ファイル: Shoping.cs プロジェクト: AnandChandrappa/demo1
        public void TC_AddProductToBasket([Values("ipad", "iphone")] string products)
        {
            test = extent.CreateTest("Test Case to Search " + products);

            var    homePage          = new home();
            var    loginPage         = new login(driver);
            var    searchPage        = new searchResults(driver);
            var    productDetailPage = new productDetail(driver);
            var    basketPage        = new basket(driver);
            string productNameCaptured;

            //Login to Amazon
            test.Log(Status.Info, "Login to Amamzon website");
            //Assert.IsTrue(homePage.verifyHomePage("Sign in"), "Amamzon home page is unavailable");
            AllClassesObjects aco = new AllClassesObjects();

            Assert.IsTrue(aco.homePage.verifyHomePage("Sign in"), "Amamzon home page is unavailable");
            homePage.clickOnSignIn();
            loginPage.setUser_email(ConfigurationManager.AppSettings.Get("email"));
            loginPage.clickOnContinue();
            loginPage.setUser_password(ConfigurationManager.AppSettings.Get("password"));
            loginPage.clickOnSubmit();
            Assert.IsTrue(homePage.verifyHomePage(ConfigurationManager.AppSettings.Get("user")), "User is not logged in");
            test.Log(Status.Info, "Login successfull");

            //Search the product in Amazon
            homePage.setSearch_Product(products);
            homePage.clickOnSearchBtn();
            productNameCaptured = searchPage.getFirstProductName();
            searchPage.verifyProductLandPage(products);
            test.Log(Status.Info, "The first product name from search list: " + productNameCaptured);
            searchPage.clickOnFirstProduct();

            //Add product to cart
            Assert.IsTrue(productDetailPage.verifyProduct(productNameCaptured), "Failed to verify the product: " + productNameCaptured);
            productDetailPage.clickOnAddToCartBtn();
            Assert.IsTrue(basketPage.verifyProductAddedToCart(), "Failed to add product to basket");
            test.Log(Status.Info, "Successfully added product to Basket");
        }
コード例 #22
0
        private void btn_file_save_Click(object sender, EventArgs e)
        {
            if (textBox_ID_visit.Text == "")
            {
                MessageBox.Show("يرجى عدم ترك حقل (رقم الزيارة) فارغ", "حقل إجباري", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (textBox_date_visit.Text == "")
            {
                MessageBox.Show("يرجى عدم ترك حقل (تاريخ الزيارة) فارغ", "حقل إجباري", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (textBox_ID_pat.Text == "")
            {
                MessageBox.Show("يرجى عدم ترك حقل (الرقم الوطني) فارغ", "حقل إجباري", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (textBox_Name_pat.Text == "")
            {
                MessageBox.Show("يرجى عدم ترك حقل (اسم المريض) فارغ", "حقل إجباري", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                try
                {
                    SqlCommand cmd = con.CreateCommand();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "dboadd_vist";

                    cmd.Parameters.Add(new SqlParameter("@ID_visit", textBox_ID_visit.Text.Trim()));
                    cmd.Parameters.Add("@date_visit", SqlDbType.NVarChar).Value = textBox_date_visit.Text.Trim();
                    cmd.Parameters.Add("@ID_pat", SqlDbType.NVarChar).Value     = textBox_ID_pat.Text.Trim();
                    cmd.Parameters.Add("@Name_pat", SqlDbType.NVarChar).Value   = textBox_Name_pat.Text.Trim();
                    cmd.Parameters.Add("@Reason", SqlDbType.NVarChar).Value     = textBox_Reason.Text.Trim();
                    cmd.Parameters.Add("@Chronic", SqlDbType.NVarChar).Value    = textBox4.Text.Trim();
                    cmd.Parameters.Add("@Diagnosis", SqlDbType.NVarChar).Value  = textBox_Diagnosis.Text.Trim();
                    cmd.Parameters.Add("@heat", SqlDbType.NVarChar).Value       = textBox_heat.Text.Trim();
                    cmd.Parameters.Add("@Pressure", SqlDbType.NVarChar).Value   = textBox_Pressure.Text.Trim();
                    cmd.Parameters.Add("@weight", SqlDbType.NVarChar).Value     = textBox_weight.Text.Trim();
                    cmd.Parameters.Add("@heart", SqlDbType.NVarChar).Value      = textBox_heart.Text.Trim();
                    cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value      = textBox_Notes.Text.Trim();
                    cmd.Parameters.Add("@Attention", SqlDbType.NVarChar).Value  = textBox_Attention.Text.Trim();
                    cmd.Parameters.Add("@add_name", SqlDbType.NVarChar).Value   = Form1.Recby;

                    var home = new home();
                    //cmd.Parameters.Add("@date", SqlDbType.NChar).Value = home.current;



                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();

                    MessageBox.Show("تم إنشاء ملف زيارة بنجاح", "عملية صحيحة", MessageBoxButtons.OK, MessageBoxIcon.Information);



                    textBox_ID_visit.Text   = "";
                    textBox_date_visit.Text = "";
                    textBox_ID_pat.Text     = "";
                    textBox_Name_pat.Text   = "";
                    textBox_Reason.Text     = "";
                    textBox4.Text           = "";
                    textBox_Diagnosis.Text  = "";
                    textBox_heat.Text       = "";
                    textBox_Pressure.Text   = "";
                    textBox_weight.Text     = "";
                    textBox_heart.Text      = "";
                    textBox_Notes.Text      = "";
                    textBox_Attention.Text  = "";


                    SqlCommand cmd2 = new SqlCommand("select ISNULL (MAX (ID_visit)+1,1) from Table_visit_patient", con);
                    con.Open();
                    SqlDataReader Ra = cmd2.ExecuteReader();

                    Ra.Read();
                    textBox_ID_visit.Text = Ra[0].ToString();
                    Ra.Close();
                    con.Close();
                }
                catch (Exception ee)
                {
                    con.Close();
                    MessageBox.Show("يرجى تصوير الخطأ ومراجعة المبرمج ، شكرا" + ee.Message, "ERROR 1005 add_visitpatientView", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #23
0
 public CrudLocatario(home inicio)
 {
     this.inicio = inicio;
 }
コード例 #24
0
 public CrudFiador(home inicio)
 {
     this.inicio = inicio;
 }
コード例 #25
0
 private void transition_Tick(object sender, EventArgs e)
 {
     for (double i = 0.1; i <= 1.0; i++)
     {
         this.Opacity += 0.015;
         t++;
         if (t == 5)
         {
             label1.Text = "Loading Dollars....";
         }
         if (t == 10)
         {
             label1.Text = "Loading Renminbi....";
             label2.Text = "Loading Dollars....";
         }
         if (t == 15)
         {
             label1.Text = "Loading Rupees....";
             label2.Text = "Loading Renminbi....";
         }
         if (t == 20)
         {
             label1.Text = "Loading Ruble....";
             label2.Text = "Loading Rupees....";
         }
         if (t == 25)
         {
             label1.Text = "Loading Dirham....";
             label2.Text = "Loading Ruble....";
         }
         if (t == 30)
         {
             label1.Text = "Loading pointlessflashscreen.exe....";
             label2.Text = "Loading Dirham....";
         }
         if (t == 35)
         {
             label1.Text = "Loading Nothing....";
             label2.Text = "Loading pointlessflashscreen.exe....";
         }
         if (t == 40)
         {
             label1.Text = "Loading Smuggling....";
             label2.Text = "Loading Nothing....";
         }
         if (t == 45)
         {
             label1.Text = "Loading Clover Smuggle Base....";
             label2.Text = "Loading Smuggling....";
         }
         if (t == 50)
         {
             label1.Text = "Loading Complete!";
             label2.Text = "Loading Clover Smuggle Base....";
         }
     }
     if (this.Opacity == 1.0)
     {
         transition.Stop();
         home open = new home();
         open.Show();
     }
 }
コード例 #26
0
 public CrudLocador(home inicio)
 {
     this.inicio = inicio;
 }
コード例 #27
0
 public CrudImovel(VerImoveis verImoveis, home inicio)
 {
     this.verImoveis = verImoveis;
     this.inicio     = inicio;
 }
コード例 #28
0
 public CrudImovel(home inicio)
 {
     this.inicio = inicio;
 }
コード例 #29
0
 public CrudFonteDeRenda(home inicio)
 {
     this.inicio = inicio;
 }
コード例 #30
0
        private void btn_file_save_Click_1(object sender, EventArgs e)
        {
            if (textBox_Number.Text == "")
            {
                MessageBox.Show("لا يمكن ترك حقل (رقم الملف ) فارغ ", "حقل إجباري", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox_Number.Focus();
                return;
            }

            if (textBox_Name.Text == "")
            {
                MessageBox.Show("لا يمكن ترك حقل (اسم المريض ) فارغ ", "حقل إجباري", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox_Name.Focus();
                return;
            }

            else
            {
                try
                {
                    con.Open();
                    SqlCommand cmd21 = new SqlCommand("select ID_pat from Table_PAT where ID_pat=@ID_pat", con);
                    cmd21.Parameters.Add(new SqlParameter("@ID_pat", textBox_Number.Text));
                    SqlDataReader dr;
                    dr = cmd21.ExecuteReader();
                    int count = 0;
                    if (dr.Read())
                    {
                        count += 1;
                    }

                    con.Close();
                    if (count == 1)
                    {
                        MessageBox.Show("رقم الملف للمريض موجودة مسبقا ، لا يمكن إضافة مريض بنفس الرقم  " + textBox_Number.Text.Trim(), "تكرار البيانات رقم الملف للمريض موجودة مسبقا !", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }
                    else
                    {
                        SqlCommand cmd = con.CreateCommand();
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.CommandText = "dboadd_file_pat";

                        cmd.Parameters.Add(new SqlParameter("@ID_pat", textBox_Number.Text.Trim()));
                        cmd.Parameters.Add("@Name_pat", SqlDbType.NVarChar).Value = textBox_Name.Text.Trim();
                        cmd.Parameters.Add(new SqlParameter("@age_pat", textbox_age.Text.Trim()));
                        cmd.Parameters.Add(new SqlParameter("@phone_pat", textbox_phone.Text.Trim()));
                        cmd.Parameters.Add("@end_Date", SqlDbType.SmallDateTime).Value = textbox_enD_Date.Value;
                        cmd.Parameters.Add(new SqlParameter("@Name_Measures", text_Measures.Text.Trim()));
                        cmd.Parameters.Add(new SqlParameter("@presnt_Measures", text_presnt_Measures.Text.Trim()));
                        cmd.Parameters.Add(new SqlParameter("@presnt_Doc", text_presnt_Doc.Text.Trim()));
                        cmd.Parameters.Add(new SqlParameter("@presnt_MM", text_presnt_MM.Text.Trim()));
                        cmd.Parameters.Add(new SqlParameter("@number_Measures", text_number_Measures.Text.Trim()));
                        cmd.Parameters.Add("@address_pat", SqlDbType.NVarChar).Value = comboBox_address.SelectedValue;
                        cmd.Parameters.Add("@city_pat", SqlDbType.NVarChar).Value    = comboBox_city.SelectedValue;
                        cmd.Parameters.Add("@cuntry_pat", SqlDbType.NVarChar).Value  = textBox_cuntrey.Text.Trim();
                        cmd.Parameters.Add("@str_pat", SqlDbType.NVarChar).Value     = textBox_str.Text.Trim();
                        cmd.Parameters.Add(new SqlParameter("@Nfamile", comboBoxNfamile.SelectedValue));
                        cmd.Parameters.Add(new SqlParameter("@Nwife", comboBox_Nwife.SelectedValue));
                        cmd.Parameters.Add("@wife1", SqlDbType.NVarChar).Value = textBox_wife1.Text.Trim();
                        cmd.Parameters.Add("@wife2", SqlDbType.NVarChar).Value = textBox_wife2.Text.Trim();
                        cmd.Parameters.Add("@wife3", SqlDbType.NVarChar).Value = textBox_wife3.Text.Trim();
                        cmd.Parameters.Add("@wife4", SqlDbType.NVarChar).Value = textBox_wife4.Text.Trim();
                        cmd.Parameters.Add(new SqlParameter("@Nch", comboBoxNch.SelectedValue));
                        cmd.Parameters.Add("@ch1", SqlDbType.NVarChar).Value  = textBox_ch1.Text.Trim();
                        cmd.Parameters.Add("@ch2", SqlDbType.NVarChar).Value  = textBox_ch2.Text.Trim();
                        cmd.Parameters.Add("@ch3", SqlDbType.NVarChar).Value  = textBox_ch3.Text.Trim();
                        cmd.Parameters.Add("@ch4", SqlDbType.NVarChar).Value  = textBox_ch4.Text.Trim();
                        cmd.Parameters.Add("@ch5", SqlDbType.NVarChar).Value  = textBox_ch5.Text.Trim();
                        cmd.Parameters.Add("@ch6", SqlDbType.NVarChar).Value  = textBox_ch6.Text.Trim();
                        cmd.Parameters.Add("@ch7", SqlDbType.NVarChar).Value  = textBox_ch7.Text.Trim();
                        cmd.Parameters.Add("@ch8", SqlDbType.NVarChar).Value  = textBox_ch8.Text.Trim();
                        cmd.Parameters.Add("@ch9", SqlDbType.NVarChar).Value  = textBox_ch9.Text.Trim();
                        cmd.Parameters.Add("@ch10", SqlDbType.NVarChar).Value = textBox_ch10.Text.Trim();
                        cmd.Parameters.Add("@ch11", SqlDbType.NVarChar).Value = textBox_ch11.Text.Trim();
                        cmd.Parameters.Add("@ch12", SqlDbType.NVarChar).Value = textBox_ch12.Text.Trim();
                        cmd.Parameters.Add("@ch13", SqlDbType.NVarChar).Value = textBox_ch13.Text.Trim();
                        cmd.Parameters.Add("@ch14", SqlDbType.NVarChar).Value = textBox_ch14.Text.Trim();
                        var home = new home();
                        cmd.Parameters.Add("@date", SqlDbType.NVarChar).Value     = home.current;
                        cmd.Parameters.Add("@add_name", SqlDbType.NVarChar).Value = Form1.Recby;



                        con.Open();
                        cmd.ExecuteNonQuery();
                        con.Close();

                        con.Open();


                        SqlCommand cmd2 = con.CreateCommand();
                        cmd2.CommandType = CommandType.StoredProcedure;
                        cmd2.CommandText = "dboadd_TT";

                        cmd2.Parameters.Add(new SqlParameter("@ID_visit", textBox_ID_visit.Text.Trim()));
                        cmd2.Parameters.Add(new SqlParameter("@ID_pat", textBox_Number.Text.Trim()));
                        cmd2.Parameters.Add("@Name_pat", SqlDbType.NVarChar).Value = textBox_Name.Text.Trim();



                        cmd2.ExecuteNonQuery();
                        con.Close();

                        //---------------------------- رسائل الخاصة ب موظفين الاستقبال-------------------------------------------------
                        SqlDataReader ddr;
                        DataTable     Dt   = new DataTable();
                        SqlCommand    ccmd = new SqlCommand("select Priv_Display from TB_Priv where Priv_User_ID=" + Convert.ToInt32(Program.user_ID) + " and Priv_Screen_ID=13", con);
                        con.Open();
                        ddr = ccmd.ExecuteReader();
                        if (ddr.Read())
                        {
                            if (ddr["Priv_Display"].ToString() == "True")
                            {
                                Send_SMS();
                            }
                        }
                        ddr.Close();
                        con.Close();



                        //---------------------------------------------------------------------------------------


                        //---------------------------- رسائل الخاصة ب موظفين الصيدلية-------------------------------------------------
                        SqlDataReader ddr2;

                        SqlCommand ccmd2 = new SqlCommand("select Priv_Display from TB_Priv where Priv_User_ID=" + Convert.ToInt32(Program.user_ID) + " and Priv_Screen_ID=14", con);
                        con.Open();
                        ddr2 = ccmd2.ExecuteReader();
                        if (ddr2.Read())
                        {
                            if (ddr2["Priv_Display"].ToString() == "True")
                            {
                                Send_SMS2();
                            }
                        }
                        ddr2.Close();
                        con.Close();



                        //---------------------------------------------------------------------------------------
                        MessageBox.Show("تم إنشاء ملف مريض", "عملية صحيحة", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        add_visitpatientView ssa = new add_visitpatientView();
                        addControlsTopanel(ssa);
                    }
                }
                catch (Exception ee)
                {
                    con.Close();
                    MessageBox.Show("يرجى تصوير الخطأ ومراجعة المبرمج ، شكرا" + ee.Message, "ERROR 1002 add_file_pat", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #31
0
 public CrudAtendimento(home inicio)
 {
     this.inicio = inicio;
 }