Beispiel #1
0
        protected void BtnDaUnesi_Click(object sender, EventArgs e)
        {
            if (lblheader.Text == "Unos novog klijenta")
            {
                ModalPopupExtender1.Hide();
                Klijent klijent = new Klijent();
                klijent.Naziv = tbNaziv.Text;

                Repozitorij.InsertKlijent(klijent);
                ModalPopupExtender1.Hide();

                int idUnesenogKlijenta = Repozitorij.GetKlijentId(klijent.Naziv);
                if (idUnesenogKlijenta != 0)
                {
                    AžurirajProjekteKlijenta(idUnesenogKlijenta);
                }
                else
                {
                    ModalPopupExtender2.Show();
                }

                ClearPoljaZaUnos();
            }
            else
            {
                ModalPopupExtender1.Hide();
                ClearPoljaZaUnos();
            }
        }
Beispiel #2
0
    protected void lnkView_Click(object sender, EventArgs e)
    {
        LinkButton LnkSeletedRow = sender as LinkButton;

        if (LnkSeletedRow != null)
        {
            GridViewRow grv = LnkSeletedRow.NamingContainer as GridViewRow;
            if (grv != null)
            {
                Label tktNumber = (Label)grv.FindControl("lbltktnoTktNumber");
                eq.TktNumber = tktNumber.Text;
                DataSet DSR = ObjDAL.GetDashboardRemarks(eq.TktNumber);
                if (DSR.Tables[0].Rows.Count > 0)
                {
                    popGridview.DataSource = DSR;
                    popGridview.DataBind();
                    popGridview.Visible = true;
                    popGridview.DataBind();
                    ModalPopupExtender2.Show();
                    UpdatePanel15.Update();
                }
                else
                {
                    string display = "Remarks is Not Found...";
                    ScriptManager.RegisterStartupScript(UpdatePanel15, UpdatePanel15.GetType(), "popup", "alert('" + display + "');", true);
                }
            }
        }
    }
 protected void btnSuggest_Click(object sender, EventArgs e)
 {
     txtSuggestServiceProvider.Text.Trim();
     if (txtSuggestServiceProvider.Text != "" && txtSuggestServiceProvider.Text != null && ddlSuggestLocation.SelectedValue != "0" && ddlSuggestLocation.SelectedValue != null)
     {
         string value           = "\""; value = Regex.Escape(value);
         string serviceProvider = Regex.Replace(txtSuggestServiceProvider.Text, value, "");
         bll.Name = Regex.Replace(serviceProvider, "'", ""); bll.LocationID = ddlSuggestLocation.SelectedValue;
         if (bll.CheckExistingServiceProviderAndLocation().Rows.Count == 0)
         {
             bll.ServiceProviderID = bll.InsertServiceProviderInSuggestion().Rows[0][0].ToString();
             Audit(uid, "INSERT", "Service_Providers", bll.ServiceProviderID);
             bll.ServiceProviderLocationID = bll.InsertServiceProviderAndLocationInSuggestion().Rows[0][0].ToString();
             Audit(uid, "INSERT", "Service_Providers_Locations", bll.ServiceProviderLocationID);
             bll.Username = uid; string SuggestionID = bll.InsertSuggestion().Rows[0][0].ToString();
             Audit(uid, "INSERT", "Suggestions", SuggestionID);
             lblSuggestError.Text = ""; txtSuggestServiceProvider.Text = ""; ddlSuggestLocation.SelectedValue = "0";
             ModalPopupExtender2.Hide(); ModalPopupExtender3.Show();
         }
         else
         {
             ModalPopupExtender2.Show();
             lblSuggestError.Text = "The Service Provider is already existing.";
         }
     }
     else
     {
         ModalPopupExtender2.Show();
         lblSuggestError.Text = "Please input the desired service provider and location.";
     }
 }
Beispiel #4
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         string saltedPasswordHash        = txtPassword.Text;
         string CurrentsaltedPasswordHash = txtCurrentPwd.Text;
         obj = new PPRDataBL();
         string success = obj.ChangeLoginIdPasswordBL(HttpUtility.HtmlEncode(txtUserId.Text), HttpUtility.HtmlEncode(CurrentsaltedPasswordHash), HttpUtility.HtmlEncode(saltedPasswordHash));
         if (success == "Password Change save successfully".Trim())
         {
             Alert.show(success.Trim());
             Lblmsg.Text      = success;
             Lblmsg.ForeColor = System.Drawing.Color.Green;
             ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
         }
         else
         {
             Alert.show(success.Trim());
             Lblmsg.Text      = success;
             Lblmsg.ForeColor = System.Drawing.Color.Red;
             ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
             ModalPopupExtender2.Show();
         }
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
Beispiel #5
0
        protected void onDeclineGrid(object sender, System.EventArgs e)
        {
            LinkButton btn = (LinkButton)sender;

            gvr = (GridViewRow)btn.NamingContainer;
            ModalPopupExtender2.Show();
        }
Beispiel #6
0
        protected void gvwNews_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            int topicId = 0;

            topicId      = Convert.ToInt32(e.CommandArgument);
            this.TopicId = topicId;

            if (e.CommandName == "cmdEdit")
            {
                SetControlName(GetNewById(topicId));

                //  TabContainer1.ActiveTab = 0;

                //btn.Visible = false;
            }
            if (e.CommandName == "cmdelete")
            {
                newsbal.DeleteNewsLetter(topicId, "Admin", DateTime.Now);
                BindNewsLetter();
                Cancel();
            }
            if (e.CommandName == "cmdDetails")
            {
                //pnlDetails.Visible = true;
                ModalPopupExtender2.Show();
            }
        }
Beispiel #7
0
 protected void btnDelete_Ok_Click(object sender, EventArgs e)
 {
     deleteTimesheet(Convert.ToInt16(Session["TimeSheetID"]));
     fillGrid(startDate.Value, Convert.ToInt16(Session["UserID"]));
     fillHoursDays(startDate.Value, Convert.ToInt16(Session["UserID"]));
     ModalPopupExtender2.Hide();
 }
        protected void GridView5_DataBound(object sender, EventArgs e)
        {
            int Sent_YN;
            int CountRows = GridView5.Rows.Count;

            if (CountRows == 1)
            {
                if (Convert.ToBoolean(GridView5.Rows[0].Cells[3].Text))
                {
                    Sent_YN = 1;
                }
                else
                {
                    Sent_YN = 0;
                }

                DropDownList3.SelectedValue = Sent_YN.ToString();

                TextBox115.Text             = TextBox21.Text;
                Label3.Text                 = GridView5.Rows[0].Cells[0].Text;
                DropDownList3.SelectedValue = GridView5.Rows[0].Cells[3].Text;
                ModalPopupExtender4.Show();
            }
            else if (CountRows > 1)
            {
                ModalPopupExtender2.Show();
            }
            else if (CountRows == 0 && TextBox21.Text.Length > 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('Δεν βρέθηκε διαβατήριο σε αναμονή με αυτά τα στοιχεία!!!!');", true);
                TextBox21.Text = "";
            }
        }
Beispiel #9
0
 protected void grdUserVerification_RowDatabound(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Activate")
     {
         string   temp   = e.CommandArgument.ToString();
         string[] tokens = temp.Split('/');
         ViewState["RecordId"]  = HttpUtility.HtmlEncode(tokens[0]);
         ViewState["UserEmail"] = HttpUtility.HtmlEncode(tokens[1]);
         ViewState["UserName"]  = HttpUtility.HtmlEncode(tokens[2]);
         ViewState["Action"]    = HttpUtility.HtmlEncode(tokens[3]);
         lblAlertMsg.Text       = "Are You sure to want to Activate Name ?";
         ModalPopupExtender2.Show();
     }
     if (e.CommandName == "De-Activate")
     {
         string   temp   = e.CommandArgument.ToString();
         string[] tokens = temp.Split('/');
         ViewState["RecordId"]  = HttpUtility.HtmlEncode(tokens[0]);
         ViewState["UserEmail"] = HttpUtility.HtmlEncode(tokens[1]);
         ViewState["UserName"]  = HttpUtility.HtmlEncode(tokens[2]);
         ViewState["Action"]    = HttpUtility.HtmlEncode(tokens[3]);
         lblAlertMsg.Text       = "Are You sure to want to De-Activate Name ?";
         ModalPopupExtender2.Show();
     }
 }
Beispiel #10
0
    protected void btnReturnItem_Click(object sender, EventArgs e)
    {
        int flag = 0;

        for (int i = 0; i < dtgReturnItems.Rows.Count; i++)
        {
            CheckBox ch = (CheckBox)dtgReturnItems.Rows[i].FindControl("chkSelect");
            if (ch.Checked == true)
            {
                flag = 1;
            }
            else
            {
                flag1 = 1;
            }
        }
        if (flag == 0)
        {
            lblOk.Text       = "Please Click on Check Box"; lblHead.Text = "Tsunami ARMS - Warning";
            pnlOk.Visible    = true;
            pnlYesNo.Visible = false;
            ModalPopupExtender2.Show();
            return;
        }
        ViewState["action1"] = "Return";
        lblMsg.Text          = "Do you want to Return this Item?"; lblHead.Text = "Tsunami ARMS- Confirmation";
        pnlOk.Visible        = false;
        pnlYesNo.Visible     = true;
        ModalPopupExtender2.Show();
        this.ScriptManager1.SetFocus(btnYes);
    }
Beispiel #11
0
        protected void gvTasks_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                //Find Row number
                int idx = Convert.ToInt32(e.CommandArgument);

                Session["TaskID"] = Convert.ToInt32(gvTasks.DataKeys[idx].Value);

                if (e.CommandName == "editTime")
                {
                    fillEdit(Convert.ToInt16(Session["TaskID"]));
                    ModalPopupExtender1.Show();
                }
                if (e.CommandName == "del")
                {
                    ModalPopupExtender2.Show();
                }
                if (e.CommandName == "Comments")
                {
                    txtComments.Text = "";
                    fillComments(Convert.ToInt16(Session["TaskID"]));
                    mpeComments.Show();
                }
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["PPRId"] != null)
     {
         hdnPPRId.Value = Session["PPRId"].ToString();
     }
     else
     {
     }
     Session["PPR1"] = null;
     if (!IsPostBack)
     {
         try
         {
             GetData();
             GetInterMediateData();
             ModalPopupExtender2.Show();
             FillReferencePpr();
         }
         catch (Exception ex)
         {
             LogError(ex);
         }
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        CartItem item = new CartItem();

        DataTable dt = DataAccess.selectQuery("SELECT * FROM PRODUCTS WHERE ID =" + id);

        DataRow row = dt.Rows[0];

        if (Int32.Parse(row["INVENTORY"].ToString()) != 0)
        {
            ShoppingCart thisCart = (ShoppingCart)Session["thisCart"];
            if (thisCart == null)
            {
                thisCart            = new ShoppingCart();
                Session["thisCart"] = thisCart;
            }

            int itemIndex     = thisCart.ItemIndexOf(Int32.Parse(id));
            int itemInventory = Int32.Parse(DataAccess.selectQuery("SELECT INVENTORY FROM PRODUCTS WHERE ID =" + id).Rows[0]["INVENTORY"].ToString());
            if (itemIndex >= 0 && thisCart.Items[itemIndex].Quantity >= itemInventory)
            {
                ModalPopupExtender2.Show();
            }
            else
            {
                thisCart.Insert(new CartItem(Int32.Parse(id), row["NAME"].ToString(), row["Image"].ToString(), row["DESCRIPTION"].ToString(), Double.Parse(row["PRICE"].ToString()), 1, Int32.Parse(row["INVENTORY"].ToString())));

                mp1.Show();
            }
        }
        else
        {
            ModalPopupExtender1.Show();
        }
    }
 protected void btnReply_Click(object sender, EventArgs e)
 {
     try
     {
         if (objMembership.CheckMembershipExists())
         {
             if (Request.QueryString["mid"] != null && btnReply.Text == "Reply")
             {
                 EnableTrue(); ReplyMSG();
             }
             else
             {
                 SendMSG();
                 EnableFalse();
                 ResetButton();
             }
         }
         else
         {
             pnlMSG.Visible = true;
             ModalPopupExtender2.Show();
             ModalPopupExtender2.CancelControlID = "btnCancle1";
         }
     }
     catch
     {
     }
 }
Beispiel #15
0
 protected void modalclose2_Click(object sender, EventArgs e)
 {
     ModalPopupExtender2.Hide();
     NewClientFinish.Visible = false;
     UpdateClient.Visible    = false;
     Button6Client.Enabled   = true;
 }
        protected void BtnUkloni_Click(object sender, EventArgs e)
        {
            if (lbProjekti.SelectedValue == string.Empty)
            {
                return;
            }

            List <Projekt> projektiKlijenta = new List <Projekt>();

            projektiKlijenta.AddRange(Repozitorij.GetProjektiKlijenta(int.Parse(ddlKlijent.SelectedValue)));


            int idProjektzaUklanjanje = int.Parse(lbProjekti.SelectedValue);

            var itemUkloni  = privremeniProjekti.Find(x => x.IDProjekt == idProjektzaUklanjanje);
            var itemPostoji = new Projekt();

            foreach (Projekt projekt in projektiKlijenta)
            {
                itemPostoji = projektiKlijenta.Find(x => x.IDProjekt == idProjektzaUklanjanje);
            }
            if (itemPostoji != null)
            {
                ModalPopupExtender2.Show();
            }
            else
            {
                privremeniProjekti.Remove(itemUkloni);
                LoadLbProjekti();
            }
        }
        public void grdListCategory_EditCommand(object source, DataGridCommandEventArgs e)
        {
            HPCBusinessLogic.DAL.T_Customer_AdsDAL obj_Cate = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                int catID = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
                Session["AsdLogolist_LangID"] = cbo_lanquage.SelectedValue;
                Response.Redirect("~/Quangcao/AdsLogoEdit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
            }
            if (e.CommandArgument.ToString().ToLower() == "viewads")
            {
                T_Customer_Ads    _obj   = new T_Customer_Ads();
                T_Customer_AdsDAL _DAL   = new T_Customer_AdsDAL();
                DataTable         _dtAds = null;
                try
                {
                    EID  = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
                    _obj = _DAL.GetOneFromT_Customer_AdsByID(EID);
                    if (_obj.Possittion.ToString() != "")
                    {
                        _dtAds = _DAL.BindGridT_Customer_Ads(_obj.Possittion.ToString().Trim()).Tables[0];

                        rptSlideShows.DataSource = _dtAds.DefaultView;
                        rptSlideShows.DataBind();
                    }

                    ModalPopupExtender2.Show();
                }
                catch (Exception ex)
                { }
            }
        }
Beispiel #18
0
 public void okmessage(string head, string message)
 {
     lblOk.Text       = message;
     pnlOk.Visible    = true;
     pnlYesNo.Visible = false;
     ModalPopupExtender2.Show();
 }
Beispiel #19
0
        protected void SaveUser_ServerClick(object sender, EventArgs e)
        {
            usuario usuario = (usuario)Session["USER"];

            if (userBusiness.UpdateMailAndPhonenumber(PhoneToEdit.Value, usuario.id_usuario, nombreModificar.Value))
            {
                message.InnerText = "Usuario actualizado con éxito";
                ModalPopupExtender2.Show();
                Session["USER"] = userBusiness.GetUpdatedUser(usuario.id_usuario);
            }
            else
            {
                message.InnerText = "Ha ocurrido un error, por favor intentelo de nuevo más tarde";
                ModalPopupExtender2.Show();
            }
            i         = 0;
            adminList = userBusiness.GetAllAdmnistrators();
            AdminUserRepeater.DataSource = adminList;
            AdminUserRepeater.DataBind();
            if (Session["USER"] != null)
            {
                usuario user = (usuario)Session["USER"];
                MailToEdit.Attributes.Add("value", user.correo);
                PhoneToEdit.Attributes.Add("value", user.telefono);
                nombreModificar.Attributes.Add("value", user.nombre);
            }
        }
Beispiel #20
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        #region BUTTON NO CLICK
        if (ViewState["action"].ToString() == "policy")
        {
            lblMsg.Text         = "Do you want to Continue?"; lblHead.Text = "Tsunami ARMS- Confirmation";
            ViewState["action"] = "Policyedit";
            pnlOk.Visible       = false;
            pnlYesNo.Visible    = true;

            ModalPopupExtender2.Show();
            this.ScriptManager1.SetFocus(btnYes);
            return;
        }
        else if (ViewState["action"].ToString() == "continue")
        {
            //this.ScriptManager1.SetFocus(cmbAllocationRequest);
            //ViewState["action"] = "NIL";
            //return;
        }
        else if (ViewState["action"].ToString() == "check")
        {
            Response.Redirect(ViewState["prevform"].ToString());
        }
        #endregion
    }
    protected void cmdMet_Click(object sender, EventArgs e)
    {
        try
        {
            Session["Show"] = "No";
            ModalPopupMethod.Show();
            if (!Helper.IsLicenced(Request.Cookies["Company"].Value))
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('This is Trial Version, Please upgrade to Full Version of this Software. Thank You.');", true);
                return;
            }
            ModalPopupExtender2.Show();
            pnlEdit.Visible      = true;
            UpdateButton.Visible = false;
            SaveButton.Visible   = true;
            ClearPanel();

            txtTransDate.Text = DateTime.Now.ToShortDateString();

            if (optionmethod.SelectedItem.Text == "Customer")
            {
                loadSupplier("Sundry Debtors");
                Label2.Text = "Select Customer *";
            }
            else if (optionmethod.SelectedItem.Text == "Supplier")
            {
                loadSupplier("Sundry Creditors");
                Label2.Text = "Select Supplier *";
            }
        }
        catch (Exception ex)
        {
            TroyLiteExceptionManager.HandleException(ex);
        }
    }
Beispiel #22
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     if (ddlinhseasons.SelectedValue != "-1")
     {
         if (ddlpolicies.SelectedValue == "-1")
         {
             if (lstSeasons.SelectedItem != null)
             {
                 #region Save
                 lblMsg.Text         = "Do you want to Save?"; lblHead.Text = "Tsunami ARMS- Confirmation";
                 ViewState["action"] = "Save";
                 pnlOk.Visible       = false;
                 pnlYesNo.Visible    = true;
                 ModalPopupExtender2.Show();
                 this.ScriptManager1.SetFocus(btnYes);
                 #endregion
             }
             else
             {
                 okmessage("Tsunami ARMS-warning", "Select current season");
             }
         }
     }
     else
     {
         okmessage("Tsunami ARMS-warning", "Select season to be inherited");
     }
 }
Beispiel #23
0
    protected void lnkBtnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            //if (!Helper.IsLicenced(Request.Cookies["Company"].Value))
            //{
            //    ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('This is Trial Version, Please upgrade to Full Version of this Software. Thank You.');", true);
            //    return;
            //}
            Reset();
            ModalPopupExtender2.Show();
            UpdateButton.Visible = false;
            AddButton.Visible    = true;
            UpdateButton.Visible = false;
            Session["LeadID"]    = "0";
            Session["contactDs"] = null;
            ShowLeadContactInfo();
            //txtCreationDate.Text = DateTime.Now.ToShortDateString();

            DateTime indianStd = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.Now, "India Standard Time");
            string   dtaa      = Convert.ToDateTime(indianStd).ToString("dd/MM/yyyy");
            txtCreationDate.Text = dtaa;

            txtCreationDate.Focus();

            txtLeadNo.Text = "- TBA -";
            DropDownList1.SelectedItem.Text = "NO";
        }
        catch (Exception ex)
        {
            TroyLiteExceptionManager.HandleException(ex);
        }
    }
Beispiel #24
0
    protected void submit_Click2(object sender, EventArgs e)
    {
        int    fldpk   = ToInt(hid_pop_fldpk.Value, -1);
        string fldname = hid_pop_fldname.Value;


        int layout_section = ToInt(poptxt1.Text, -1);
        int layout_row     = ToInt(poptxt2.Text, -1);
        int layout_col     = ToInt(poptxt3.Text, -1);

        string fieldlabel         = poptxt4.Text;
        string aspxfieldlabeltext = poptxt5.Text;

        int    fldtypepk = ToInt(poptxt6.Text, -1);
        string missval   = poptxt7.Text;

        int width_box   = ToInt(poptxtWidth_box.Text, 40);
        int width_label = ToInt(poptxtWidth_label.Text, 100);


        if (fldpk > 0)
        {
            UpdateSingleField(fldpk, fldname, layout_section, layout_row, layout_col, fieldlabel, aspxfieldlabeltext, fldtypepk, missval, width_label, width_box);
        }

        ModalPopupExtender2.Hide();

        LoadLayout(ddlMeas.SelectedValue);
        panelDEMainBody.Update();
    }
 protected void gvPopUpGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     /// <summary>
     /// This event is used for indexing in popup grid for all the popups.
     /// </summary>
     try
     {
         gvPopUpGrid.PageIndex = e.NewPageIndex;
         if (HidPopUpType.Value == "User")
         {
             FillAllUser(txtSearchFromPopup.Text.Trim());
         }
         else if (HidPopUpType.Value == "Customer")
         {
             FillAllCustomer(txtSearchFromPopup.Text.Trim());
         }
         else if (HidPopUpType.Value == "CustomerGroup")
         {
             FillAllCustomerGroup(txtSearchFromPopup.Text.Trim());
         }
         txtSearchFromPopup.Focus();
         ModalPopupExtender2.Show();
     }
     catch { }
 }
Beispiel #26
0
        protected void btnImmediateRelative_Click(object sender, EventArgs e)
        {
            try
            {
                string employeeid = Convert.ToString(Session["EID"]);
                HRM_PersonalInformations personalObj = employeeBll.getPersonalInfosByID(employeeid);
                txtbxFatherName.Text         = personalObj.FatherName;
                txtbxFatherAge.Text          = personalObj.FatherAge;
                txtbxFatherProfession.Text   = personalObj.FatherProfession;
                txtbxMotherName.Text         = personalObj.MotherName;
                txtbxMotherAge.Text          = personalObj.MotherAge;
                txtbxMotherProfession.Text   = personalObj.MotherProfession;
                txtbxSpourseName.Text        = personalObj.SpouseName;
                txtbxSpourseAge.Text         = personalObj.SpouseAge;
                txtbxSpourseProfession.Text  = personalObj.SpouseProfession;
                txtbxNumberOfChilldren.Text  = personalObj.NumberOfChildren;
                txtbxChildrenNameRemark.Text = personalObj.ChildrenNameRemark;

                //Button4.Visible = true;
                btnTraingUpdateAndSumit.Visible = true;
                ModalPopupExtender2.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void Notification(SqlConnection cnn)
        {
            char           usertype  = 'A';
            string         notiftype = "Message";
            string         notif     = "You've got a message.";
            string         sql       = "INSERT INTO Notifications ([Usertype], [Notiftype], [Notification], [EntryDate]) values(@Usertype, @Notiftype, @Notification, @EntryDate)";
            SqlDataAdapter adapter   = new SqlDataAdapter();

            using (SqlCommand cmd = new SqlCommand(sql, cnn))
            {
                cmd.Parameters.Add("@Usertype", SqlDbType.Char, 1).Value           = usertype;
                cmd.Parameters.Add("@Notiftype", SqlDbType.NVarChar, 50).Value     = notiftype;
                cmd.Parameters.Add("@Notification", SqlDbType.NVarChar, 500).Value = notif;
                cmd.Parameters.Add("@EntryDate", SqlDbType.DateTime).Value         = DateTime.Now;
                adapter.InsertCommand = cmd;
                if (cmd.ExecuteNonQuery() == 1)
                {
                    ModalPopupExtender2.Show();
                    panelPopUp.Enabled = true;
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("Message could not be sent.");
                }
            }
        }
Beispiel #28
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if (txtmidSearch.Text.Trim() == "")
        {
            //SqlDataSourceMember.SelectCommand = "SELECT   MemberId, FirstName+' '+MiddleName+' '+LastName as MemberName from Member_Incentive_Point_Summary , User_M  where User_M.User_Id=Member_Incentive_Point_Summary.MemberId";
            SqlDataSourceMember.SelectCommand = " SELECT distinct top 10  MemberId,AuthorName as MemberName from Member_Incentive_Point_Summary , Publishcation_Author where Publishcation_Author.EmployeeCode=Member_Incentive_Point_Summary.MemberId and MemberType!='N' ";
            popGridSearch.DataSourceID        = "SqlDataSourceMember";
            popGridSearch.DataBind();
            popGridSearch.Visible = true;
        }

        else
        {
            SqlDataSourceMember.SelectParameters.Clear();
            SqlDataSourceMember.SelectParameters.Add("MemberId", txtmidSearch.Text);

            //    SqlDataSourceMember.SelectCommand = "SELECT   MemberId, FirstName+' '+MiddleName+' '+LastName as MemberName from Member_Incentive_Point_Summary , User_M  where User_M.User_Id=Member_Incentive_Point_Summary.MemberId and MemberId like '%" + txtmidSearch.Text + "%'";
            SqlDataSourceMember.SelectCommand = " SELECT distinct top 1  MemberId,AuthorName as MemberName from Member_Incentive_Point_Summary , Publishcation_Author where Publishcation_Author.EmployeeCode=Member_Incentive_Point_Summary.MemberId and MemberType!='N'  and MemberId =@MemberId";
            popGridSearch.DataSourceID        = "SqlDataSourceMember";
            popGridSearch.DataBind();
            popGridSearch.Visible = true;
        }

        ModalPopupExtender2.Show();
    }
    protected void btnViewStudent_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("Studentsp", cn);

        cn.Open();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@action", "ViewInfo");
        cmd.Parameters.AddWithValue("@rollno", txtRollNo.Text);
        cmd.Parameters.AddWithValue("@session", Session["admin"]);
        SqlDataReader dr = cmd.ExecuteReader();
        DataTable     dt = new DataTable();

        dt.Load(dr);
        cn.Close();

        if (dt.Rows.Count > 0)
        {
            imgStudent.ImageUrl     = "StudentImages/" + dt.Rows[0]["StudentImage"].ToString();
            lblStudentName.Text     = dt.Rows[0]["Name"].ToString();
            lblEmail.Text           = dt.Rows[0]["Email"].ToString();
            lblAddress.Text         = dt.Rows[0]["Address"].ToString();
            lblMobileNo.Text        = dt.Rows[0]["MobileNo"].ToString();
            lblProgramme.Text       = dt.Rows[0]["Programme"].ToString();
            pnlStudentInfo.Visible  = true;
            pnlStudentError.Visible = false;
        }
        else
        {
            pnlStudentError.Visible = true;
            pnlStudentInfo.Visible  = false;
        }
        ModalPopupExtender2.Show();
    }
Beispiel #30
0
 private void Mensajes_Usuario2()
 {
     Pmensaje2.CssClass  = this.Session["cssclass"].ToString();
     LblEncabezado2.Text = this.Session["encabemensa"].ToString();
     LblMesanje2.Text    = this.Session["mensaje"].ToString();
     ModalPopupExtender2.Show();
 }