コード例 #1
0
    protected void btn_Click(object sender, EventArgs e)
    {
        DrpPeriod.Visible = false;
        DrpRoom.Visible   = false;
        TxtPeriod.Visible = true;
        TxtRoom.Visible   = true;
        LinkButton btn = (LinkButton)sender;
        string     id  = (string )btn.ID;

        if (id.Equals("L11"))
        {
            TxtPeriod.Text = "1"; DrpDay.Text = "Mon";
        }
        if (id.Equals("L12"))
        {
            TxtPeriod.Text = "2"; DrpDay.Text = "Mon";
        }
        if (id.Equals("L13"))
        {
            TxtPeriod.Text = "3"; DrpDay.Text = "Mon";
        }
        if (id.Equals("L14"))
        {
            TxtPeriod.Text = "4"; DrpDay.Text = "Mon";
        }
        if (id.Equals("L15"))
        {
            TxtPeriod.Text = "5"; DrpDay.Text = "Mon";
        }
        if (id.Equals("L16"))
        {
            TxtPeriod.Text = "6"; DrpDay.Text = "Mon";
        }
        if (id.Equals("L21"))
        {
            TxtPeriod.Text = "1"; DrpDay.Text = "Tue";
        }
        if (id.Equals("L22"))
        {
            TxtPeriod.Text = "2"; DrpDay.Text = "Tue";
        }
        if (id.Equals("L23"))
        {
            TxtPeriod.Text = "3"; DrpDay.Text = "Tue";
        }
        if (id.Equals("L24"))
        {
            TxtPeriod.Text = "4"; DrpDay.Text = "Tue";
        }
        if (id.Equals("L25"))
        {
            TxtPeriod.Text = "5"; DrpDay.Text = "Tue";
        }
        if (id.Equals("L26"))
        {
            TxtPeriod.Text = "6"; DrpDay.Text = "Tue";
        }
        if (id.Equals("L31"))
        {
            TxtPeriod.Text = "1"; DrpDay.Text = "Wed";
        }
        if (id.Equals("L32"))
        {
            TxtPeriod.Text = "2"; DrpDay.Text = "Wed";
        }
        if (id.Equals("L33"))
        {
            TxtPeriod.Text = "3"; DrpDay.Text = "Wed";
        }
        if (id.Equals("L34"))
        {
            TxtPeriod.Text = "4"; DrpDay.Text = "Wed";
        }
        if (id.Equals("L35"))
        {
            TxtPeriod.Text = "5"; DrpDay.Text = "Wed";
        }
        if (id.Equals("L36"))
        {
            TxtPeriod.Text = "6"; DrpDay.Text = "Wed";
        }
        if (id.Equals("L41"))
        {
            TxtPeriod.Text = "1"; DrpDay.Text = "Thurs";
        }
        if (id.Equals("L42"))
        {
            TxtPeriod.Text = "2"; DrpDay.Text = "Thurs";
        }
        if (id.Equals("L43"))
        {
            TxtPeriod.Text = "3"; DrpDay.Text = "Thurs";
        }
        if (id.Equals("L44"))
        {
            TxtPeriod.Text = "4"; DrpDay.Text = "Thurs";
        }
        if (id.Equals("L45"))
        {
            TxtPeriod.Text = "5"; DrpDay.Text = "Thurs";
        }
        if (id.Equals("L46"))
        {
            TxtPeriod.Text = "6"; DrpDay.Text = "Thurs";
        }
        if (id.Equals("L51"))
        {
            TxtPeriod.Text = "1"; DrpDay.Text = "Fri";
        }
        if (id.Equals("L52"))
        {
            TxtPeriod.Text = "2"; DrpDay.Text = "Fri";
        }
        if (id.Equals("L53"))
        {
            TxtPeriod.Text = "3"; DrpDay.Text = "Fri";
        }
        if (id.Equals("L54"))
        {
            TxtPeriod.Text = "4"; DrpDay.Text = "Fri";
        }
        if (id.Equals("L55"))
        {
            TxtPeriod.Text = "5"; DrpDay.Text = "Fri";
        }
        if (id.Equals("L56"))
        {
            TxtPeriod.Text = "6"; DrpDay.Text = "Fri";
        }
        if (id.Equals("L61"))
        {
            TxtPeriod.Text = "1"; DrpDay.Text = "Sat";
        }
        if (id.Equals("L62"))
        {
            TxtPeriod.Text = "2"; DrpDay.Text = "Sat";
        }
        if (id.Equals("L63"))
        {
            TxtPeriod.Text = "3"; DrpDay.Text = "Sat";
        }
        if (id.Equals("L64"))
        {
            TxtPeriod.Text = "4"; DrpDay.Text = "Sat";
        }
        if (id.Equals("L65"))
        {
            TxtPeriod.Text = "5"; DrpDay.Text = "Sat";
        }
        if (id.Equals("L66"))
        {
            TxtPeriod.Text = "6"; DrpDay.Text = "Sat";
        }
        all           = btn.Text;
        all           = all.Replace("<br/>", string.Empty);
        lscode        = all.Substring(0, 8);
        Session["b1"] = lscode;
        LblSCode.Text = lscode;
        int start = all.IndexOf("(") + 1;
        int m     = start - 9;
        int end   = all.IndexOf(")", start);

        lteacher        = all.Substring(8, m);
        lroom           = all.Substring(start, end - start);
        LblTeacher.Text = lteacher;
        TxtRoom.Text    = lroom;
        BindDrpRoom();
        ld                = DrpDay.Text;
        lp                = TxtPeriod.Text;
        Session["b2"]     = lteacher;
        Session["b3"]     = lp;
        Session["b4"]     = ld;
        Session["b5"]     = lroom;
        DrpPeriod.Visible = false;
        DrpRoom.Visible   = false;
        ModalPopupExtender1.Show();
    }
コード例 #2
0
 protected void ddlAgency_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.getAgencyDetails(ddlAgency, lstToEmail, lstToSelectedEmail);
     ModalPopupExtender1.Show();
 }
コード例 #3
0
    protected void lnkGenrateInvoice_Click(object sender, EventArgs e)
    {
        LinkButton lnk = (LinkButton)sender;
        var        s   = from a in dc.Purchases
                         join ord in dc.Order_To_Medicine_Companies on a.OrderIDToMC equals ord.OrderIDToMC
                         join ords in dc.Order_To_Medicine_Company_Per_Medicines on ord.OrderIDToMC equals ords.OrderIDToMC
                         join medi in dc.Medicine_In_Stocks on ords.MedicineID equals medi.MedicineID
                         where a.PurchaseID == Convert.ToDecimal(lnk.CommandArgument)
                         select new
        {
            medi.MedicineID,
            medi.MedicineName,
            medi.PackSize,
            medi.BatchNo,
            medi.ExpiryDate,
            medi.Price,
            ords.Amount,
            // ords.Discount,
            // ords.DiscountAmount,
            ords.NetAmount
        };
        var chk = from a in dc.Purchase_Invoices
                  where a.PurchaseID == Convert.ToInt32(lnk.CommandArgument)
                  select a.PurchaseID;

        if (!chk.Any())
        {
            var sp = (from a in dc.Purchases
                      join ord in dc.Order_To_Medicine_Companies on a.OrderIDToMC equals ord.OrderIDToMC
                      join ords in dc.Order_To_Medicine_Company_Per_Medicines on ord.OrderIDToMC equals ords.OrderIDToMC
                      join medi in dc.Medicine_In_Stocks on ords.MedicineID equals medi.MedicineID
                      where a.PurchaseID == Convert.ToDecimal(lnk.CommandArgument)
                      select ords.NetAmount).Sum();
            var sa = (from a in dc.Purchases
                      join ord in dc.Order_To_Medicine_Companies on a.OrderIDToMC equals ord.OrderIDToMC
                      join ords in dc.Order_To_Medicine_Company_Per_Medicines on ord.OrderIDToMC equals ords.OrderIDToMC
                      join medi in dc.Medicine_In_Stocks on ords.MedicineID equals medi.MedicineID
                      where a.PurchaseID == Convert.ToDecimal(lnk.CommandArgument)
                      select ords.Amount).Sum();
            Purchase_Invoice si = new Purchase_Invoice
            {
                PurchaseID   = Convert.ToDecimal(lnk.CommandArgument),
                Price        = sp,
                Quantity     = sa,
                pInvoiceDate = DateTime.Now
            };
            dc.Purchase_Invoices.InsertOnSubmit(si);
            dc.SubmitChanges();
        }
        var medicalstore = from a in dc.Purchases
                           join ord in dc.Order_To_Medicine_Companies on a.OrderIDToMC equals ord.OrderIDToMC
                           join ords in dc.Order_To_Medicine_Company_Per_Medicines on ord.OrderIDToMC equals ords.OrderIDToMC
                           join medical in dc.Medicine_Companies on ord.MedicineCompanyID equals medical.MedicineCompanyID
                           join medi in dc.Medicine_In_Stocks on ords.MedicineID equals medi.MedicineID
                           where a.PurchaseID == Convert.ToInt32(lnk.CommandArgument)
                           select new { medical.MedicineCompanyName, medical.Phone, medical.Address, medical.Email };

        lblStoreName.Text = medicalstore.First().MedicineCompanyName;
        lblPhone.Text     = Convert.ToString(medicalstore.First().Phone);
        lblAddress.Text   = medicalstore.First().Address;
        lblemail.Text     = medicalstore.First().Email;
        var sale = from a in dc.Purchase_Invoices
                   where a.PurchaseID == Convert.ToInt32(lnk.CommandArgument)
                   select new { a.Price, a.pInvoiceDate };
        var net = (from a in dc.Purchases
                   join ord in dc.Order_To_Medicine_Companies on a.OrderIDToMC equals ord.OrderIDToMC
                   join ords in dc.Order_To_Medicine_Company_Per_Medicines on ord.OrderIDToMC equals ords.OrderIDToMC
                   where a.PurchaseID == Convert.ToInt32(lnk.CommandArgument)
                   select ords.NetAmount).Sum();

        lblAmount.Text       = Convert.ToString(net);//Convert.ToString( NetTotal); //Convert.ToString(sale.First().Price);
        lblDate.Text         = Convert.ToString(sale.First().pInvoiceDate);
        gvInvoice.DataSource = s;
        gvInvoice.DataBind();
        ModalPopupExtender1.Show();
    }
コード例 #4
0
 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     ModalPopupExtender1.Show();
 }
コード例 #5
0
        protected void btnSaveNewBusinessUnit_Click(object sender, EventArgs e)
        {
            bool   isFormFilled            = true;
            string display                 = "";
            BusinessUnitReportingChild li  = new BusinessUnitReportingChild();
            string businessUnitCode        = newBusinessUnitCode.Text;
            string businessUnitName        = newBusinessUnitName.Text;
            string businessUnitManagerName = newBusinessUnitManagerName.SelectedValue.ToString();
            string companyName             = newCompanyName.SelectedValue.ToString();
            string effectiveDate           = Request.Form[newEffectiveDate.UniqueID];


            if (String.IsNullOrEmpty(effectiveDate) || String.IsNullOrEmpty(businessUnitCode) ||
                String.IsNullOrEmpty(businessUnitName) || String.IsNullOrEmpty(businessUnitManagerName) || companyName.Equals("Select One"))
            {
                display = "Please select all the mandatory fields ";
                ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('" + display + "');", true);
                isFormFilled = false;
            }


            if (isFormFilled)
            {
                if (memberships == 1 || memberships == 2)
                {
                    DataSet result = li.AddNewBusinessUnit(businessUnitCode, businessUnitName, businessUnitManagerName, companyName, effectiveDate);

                    string res = Convert.ToString(result.Tables[0].Rows[0].ItemArray[0]);
                    if (res.Contains("Effective Date should be after"))
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('" + res + "');", true);
                        isFormFilled = false;
                        ModalPopupExtender1.Show();
                    }
                    else if (res.Equals("Duplicate BusinessUnitCode"))
                    {
                        display = "Business Unit Code already exists in the database";
                        ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('" + display + "');", true);
                        isFormFilled = false;
                    }
                    else if (res.Equals("Duplicate BusinessUnitName"))
                    {
                        display = "Business Unit Name already exists in the database";
                        ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('" + display + "');", true);
                        isFormFilled = false;
                    }
                    else if (res.Equals("Success"))
                    {
                        display = "A new Business Unit is successfully added in the database";
                        ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('" + display + "');", true);
                        isFormFilled = true;
                    }
                    if (isFormFilled)
                    {
                        newBusinessUnitCode.Text = "";
                        newBusinessUnitName.Text = "";
                        ddlBusinessUnitManagerName.DataSource    = li.BusinessUnitManagerNameList().Tables[0];
                        ddlBusinessUnitManagerName.DataTextField = "BusinessUnitManagerName";
                        ddlBusinessUnitManagerName.DataBind();

                        ddlCompanyName.DataSource    = li.CompanyNameList().Tables[0];
                        ddlCompanyName.DataTextField = "CompanyName";
                        ddlCompanyName.DataBind();
                        BindGridView();
                    }
                }

                else
                {
                    display = "You must be a member of Consolidated Sales Reporting – Admin or Consolidated Sales Reporting – Finance  groups to Add New Business Units.";
                    ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + display + "');", true);
                }
            }
        }
コード例 #6
0
    protected void GridEmail_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete1")
        {
            int indx = Convert.ToInt32(e.CommandArgument);

            SqlDataAdapter dafv = new SqlDataAdapter("select SetforOutgoingemail from InOutCompanyEmail where ID='" + indx + "'", con);
            DataTable      dtfv = new DataTable();
            dafv.Fill(dtfv);

            if (Convert.ToString(dtfv.Rows[0]["SetforOutgoingemail"]) == "True")
            {
                ModalPopupExtender1.Show();
            }
            else
            {
                if (indx != null)
                {
                    string     result1 = "delete from InOutCompanyEmail where ID='" + indx + "'";
                    SqlCommand cmddel  = new SqlCommand(result1, con);
                    if (con.State.ToString() != "Open")
                    {
                        con.Open();
                    }
                    cmddel.ExecuteNonQuery();
                    con.Close();
                    FillGrid();
                    lblext.Text = "Record deleted successfully.";
                }
            }
        }

        if (e.CommandName == "Edit")
        {
            btnadddd.Visible = false;
            pnladdd.Visible  = true;
            Label24.Text     = "Edit Company Email";
            lblext.Text      = "";

            int datakey = Convert.ToInt32(e.CommandArgument);
            Session["EmailID"] = datakey;
            DataTable dt = new DataTable();

            dt = select("SELECT ID,EmailName,OutgoingEmailServer, OutEmailID,Whid, OutPassword,IncomingEmailServer,InEmailID,InPassword,LastDownloadedTime,LastDownloadIndex,SetforOutgoingemail,EmailId,EmployeeID,InPort,OutPort FROM         InOutCompanyEmail where  ID='" + datakey + "'");

            if (dt.Rows.Count > 0)
            {
                ddlstore.SelectedIndex = ddlstore.Items.IndexOf(ddlstore.Items.FindByValue(dt.Rows[0]["Whid"].ToString()));

                if (Convert.ToString(dt.Rows[0]["EmployeeID"]) != "0")
                {
                    RadioButtonList1.SelectedValue = "2";
                    RadioButtonList1_SelectedIndexChanged(sender, e);
                    ddlemp.SelectedIndex = ddlemp.Items.IndexOf(ddlemp.Items.FindByValue(dt.Rows[0]["EmployeeID"].ToString()));
                }
                else
                {
                    RadioButtonList1.SelectedValue = "1";
                    RadioButtonList1_SelectedIndexChanged(sender, e);
                }

                txtmemailname.Text = Convert.ToString(dt.Rows[0]["EmailName"].ToString());

                txtemail.Text = Convert.ToString(dt.Rows[0]["EmailId"].ToString());

                txtoutserver.Text = Convert.ToString(dt.Rows[0]["OutgoingEmailServer"].ToString());

                txtoutemail.Text = Convert.ToString(dt.Rows[0]["OutEmailID"].ToString());

                txtport1.Text = Convert.ToString(dt.Rows[0]["InPort"].ToString());

                txtport2.Text = Convert.ToString(dt.Rows[0]["OutPort"].ToString());

                if (txtoutpass.TextMode == TextBoxMode.Password)
                {
                    txtoutpass.Text = Convert.ToString(dt.Rows[0]["OutPassword"].ToString());
                    txtoutpass.Attributes.Add("value", txtoutpass.Text);
                }
                txtserver.Text = Convert.ToString(dt.Rows[0]["IncomingEmailServer"].ToString());

                txtuser.Text = Convert.ToString(dt.Rows[0]["InEmailID"].ToString());


                if (txtpass.TextMode == TextBoxMode.Password)
                {
                    txtpass.Text = Convert.ToString(dt.Rows[0]["InPassword"].ToString());
                    txtpass.Attributes.Add("value", txtpass.Text);
                }
                bool sts = false;
                if (dt.Rows[0]["SetforOutgoingemail"] != System.DBNull.Value)
                {
                    sts = Convert.ToBoolean(dt.Rows[0]["SetforOutgoingemail"].ToString());
                }
                if (sts == true)
                {
                    CheckBox1.Checked = true;
                }
                dt = select("Select * from EmailSignatureMaster where  InoutgoingMasterId='" + Session["EmailID"] + "'");

                if (dt.Rows.Count > 0)
                {
                    CheckBox3.Checked = true;
                }
                imgupdate.Visible = true;
                imgbtnsubmitCabinetAdd.Visible = false;
                imgcancel.Visible = true;
            }
        }
        else if (e.CommandName == "Viewsignature")
        {
            int datakey = Convert.ToInt32(e.CommandArgument);
            Session["EmailID"] = datakey;
            DataTable dt = new DataTable();
            dt = select("Select * from EmailSignatureMaster where  InoutgoingMasterId='" + Session["EmailID"] + "'");

            if (dt.Rows.Count > 0)
            {
                string   strValues = Convert.ToString(dt.Rows[0]["Signature"]);
                string[] strArray  = strValues.Split(':');

                TextBox1.Text = strArray[0];

                int rr = Convert.ToInt32(strArray.Length);

                if (strValues.Contains(":") && rr <= 4)
                {
                    TextBox2.Text = strArray[1];
                    TextBox3.Text = strArray[2];
                    TextBox4.Text = strArray[3];
                }
                else
                {
                    TextBox2.Text = strArray[1];
                    TextBox3.Text = strArray[2];
                    TextBox4.Text = strArray[3];

                    TextBox5.Text = strArray[4];
                    TextBox6.Text = strArray[5];
                    TextBox7.Text = strArray[6];

                    TextBox8.Text  = strArray[7];
                    TextBox9.Text  = strArray[8];
                    TextBox10.Text = strArray[9];
                }


                //string[] separator1 = new string[] { ":" };
                //string[] strSplitArr1 = Convert.ToString(dt.Rows[0]["Signature"]).Split(separator1, StringSplitOptions.RemoveEmptyEntries);

                // txtsignature.Text = Convert.ToString(dt.Rows[0]["Signature"]);
                ImageButton4.Visible = false;
                btnsigup.Visible     = true;
                ModalPopupExtender2.Show();
            }
            else
            {
                TextBox1.Text  = "";
                TextBox2.Text  = "";
                TextBox3.Text  = "";
                TextBox4.Text  = "";
                TextBox5.Text  = "";
                TextBox6.Text  = "";
                TextBox7.Text  = "";
                TextBox8.Text  = "";
                TextBox9.Text  = "";
                TextBox10.Text = "";

                ImageButton4.Visible = true;
                btnsigup.Visible     = false;
                ModalPopupExtender2.Show();
            }
            lblmmms.Text         = "";
            imgbtncancel.Visible = true;
        }
    }
コード例 #7
0
        protected void Unnamed_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["NephroCare"].ConnectionString);

            con.Open();

            bool m = Nephro_Care.Checkduplicate.getmethod(AadharNumbertxt.Text);

            if (m == true)
            {
                lblpopup.Text = "user already exists";

                ModalPopupExtender1.Show();
            }
            else
            {
                ModalPopupExtender1.Show();
                con.Close();
                HttpPostedFile ps   = fppic1.PostedFile;
                Stream         s    = ps.InputStream;
                BinaryReader   br   = new BinaryReader(s);
                Byte[]         sdat = br.ReadBytes((int)s.Length);
                SqlCommand     cmd  = new SqlCommand("Table1_inst", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@pic", sdat);
                cmd.Parameters.Add(new SqlParameter("@Aadhar_Number", Convert.ToInt32(AadharNumbertxt.Text.Trim())));
                cmd.Parameters.Add(new SqlParameter("@Name", Nametxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Age", Agetxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@gender", Gender.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Date_Of_Birth", DateOfBirthtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@First_Name", FirstNametxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Family_Name", FamilyNametxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Address", Addresstxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Mobile_No", PhoneNotxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Email_Id", EmailIdtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Education", Educationtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Occupation", Occupationtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Financial_Status", FinancialStatustxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@BGT", BGTtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Treating_Doctor", TreatingDoctortxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@reference_by", RadioButtonList2.SelectedValue));
                cmd.Parameters.Add(new SqlParameter("@OPNO", OPNOtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Weight_kgs", Weighttxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Height_cms", Heighttxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@BSA", BSAtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@BMI", BMItxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@MDRD_GFR", MDRDGFRtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Blood_Group", DropDown1.SelectedValue));
                cmd.Parameters.Add(new SqlParameter("@HBs_Ag", HBsAgtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@HCV", HCVtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@HIV", HIVtxt.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@DM_DMN", DMN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@HTN", HTN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@CKD_Stage", CKDStage.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@CGN", CGN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@CIN", CIN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@ESRD", ESRD.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Ac_CRF", AcCRF.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@ARF", ARF.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@RPRF", RPRF.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@AGN", AGN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@NS", NS.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@SLE", SLE.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@MCD", MCD.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@MN", MN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@FSGS", FSGS.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@MPGN", MPGN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Ig_A", IgA.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Cres_GN", CresGN.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@ADPKD", ADPKD.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@MM", MM.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Amyld", AmyId.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@RTA", RTA.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@RAS", RAS.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@VUR", VUR.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@ROD", ROD.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Ob_Ur", ObUr.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Fluorisis", Fluorosis.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Rickets", Rickets.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Cancer", Cancer.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@HKPP", HKPP.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@UTI", UTI.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@BPH", BPH.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Malaria", Malaria.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Post_GE", PostGE.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@SnakeBite", SnakeBite.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Sepsis", Sepsis.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Alport", Alport.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@HSP", HSP.Text.Trim()));
                cmd.Parameters.Add(new SqlParameter("@Others", OTHERS.Text.Trim()));
                con.Open();
                cmd.ExecuteNonQuery();

                ModalPopupExtender1.Hide();
            }
        }
コード例 #8
0
 public void newKey()
 {
     txtName.Text = txtDescription.Text = txtSynonims.Text = hdnThesaurusID.Value = hdnThesaurusKeyID.Value = string.Empty;
     UIMode       = SystemConstants.FormMode.New.ToString();
     ModalPopupExtender1.Show();
 }
コード例 #9
0
 public void Mostrar()
 {
     ModalPopupExtender1.Show();
 }
コード例 #10
0
ファイル: AltaTicket.aspx.cs プロジェクト: jesumarquez/lt
 protected override void Cancel()
 {
     ModalPopupExtender1.Show();
     updAnular.Update();
 }
コード例 #11
0
    protected void frmViewAdd_ItemInserted(object sender, FormViewInsertedEventArgs e)
    {
        if (e.Exception == null)
        {
            //MyAccordion.Visible = true;
            lnkBtnAdd.Visible     = true;
            frmViewAdd.Visible    = false;
            GrdViewLedger.Visible = true;
            System.Threading.Thread.Sleep(1000);
            GrdViewLedger.DataBind();

            if (txtSearch.Text == "")
            {
            }
            else
            {
                txtSearch.Text = "";
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);
            }


            StringBuilder scriptMsg = new StringBuilder();
            scriptMsg.Append("alert('Task Status Information Saved Successfully.');");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), scriptMsg.ToString(), true);
        }
        else
        {
            if (e.Exception != null)
            {
                StringBuilder script = new StringBuilder();
                script.Append("alert('Task Status with this name already exists, Please try with a different name.');");
                // Response.Write("Task Status with this name already exists, Please try with a different name.");

                //Response.Write("TaskStatus.aspx");



                // tbMain.Visible = true;
                //return;

                if (e.Exception.InnerException != null)
                {
                    if ((e.Exception.InnerException.Message.IndexOf("duplicate values in the index") > -1) ||
                        (e.Exception.InnerException.Message.IndexOf("Task Status Exists") > -1))
                    {
                        e.ExceptionHandled = true;
                        e.KeepInInsertMode = true;
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script.ToString(), true);
                        ModalPopupExtender1.Show();
                        return;
                    }
                    // tbMain.Visible = true;


                    return;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "Exception: " + e.Exception.Message + e.Exception.StackTrace, true);
                }
            }
            //Response.Redirect("TaskStatus.aspx");
            // this.frmViewAdd_ItemInserting(sender, e);
            e.KeepInInsertMode = true;
            e.ExceptionHandled = true;


            //Response.Write("alert('Task Status with this name already exists, Please try with a different name.');");
        }
    }
コード例 #12
0
        protected void btnSaveComments_Click(object sender, EventArgs e)
        {
            if (txtComments.Text != "")
            {
                Utility   objUtil    = new Utility();
                DataTable dt         = new DataTable();
                string    folderPath = string.Empty;
                //if (ViewState["iEventId"] == null)
                //{
                //Check for Upload file
                //lblCheck.Visible = false;
                //********************code to file verify

                if (fupReplyFile.PostedFile.FileName != "")
                {
                    //Find the Uploaded Filename
                    string filepath    = fupReplyFile.PostedFile.FileName;
                    string contenttype = string.Empty;
                    //********************code to file verify
                    if (validatepdf())
                    {
                        contenttype = "application/pdf";
                        folderPath  = Server.MapPath("~/writedata/Events/");
                    }
                    else
                    {
                        lblMessage.Text = "File Format Not Supported";
                        return;
                    }
                    //************************* code end here

                    fileName = "Comments_" + iNominationID + "_" + GetDate(DateTime.Now);
                    if (SaveComments(Convert.ToInt32(ViewState["EventId"].ToString()), fileName) > 0)
                    {
                        //SaveComments(Convert.ToInt32(iNominationID), fileName);
                        lblMessage.Text = "Comments Sucessfully Saved, Topic ID is -" + iNominationID;
                        if (fupReplyFile.HasFile == true)
                        {
                            fupReplyFile.PostedFile.SaveAs(folderPath + "\\" + fileName + ".pdf");
                        }
                        try
                        {
                            string   nameOfSender = ((UserDetails)Session[clsConstant.TOKEN]).FirstName.ToString() + ' ' + ((UserDetails)Session[clsConstant.TOKEN]).LastName.ToString();
                            string[] sListToEmail = new string[lstToSelectedEmail.Items.Count + 1];  // before hre two

                            string emailAlert = string.Empty;
                            emailAlert = "";
                            int iloop;

                            for (iloop = 0; iloop < lstToSelectedEmail.Items.Count; iloop++)
                            {
                                sListToEmail[iloop] = lstToSelectedEmail.Items[iloop].Value;

                                string email  = lstToSelectedEmail.Items[iloop].Text;
                                int    getPos = email.IndexOf("),");
                                emailAlert += email.Substring(getPos + 2) + ';';
                            }
                            // if (ds.Tables[0].Rows.Count > 0)
                            //  {
                            // emailAlert += ds.Tables[0].Rows[0]["vsEmailID"].ToString() + ';';
                            sListToEmail[iloop] = getToUserEmail(ViewState["EventId"].ToString());
                            //  }


                            emailAlert += (((UserDetails)Session[clsConstant.TOKEN]).EmailID).ToString() + ';';
                            SendEmailForWorkshopReply(txtComments.Text, ViewState["EventId"].ToString(), ViewState["vsTopic"].ToString(), "Workshop Comment", emailAlert, nameOfSender,
                                                      ((UserDetails)Session[clsConstant.TOKEN]).Designation, ((UserDetails)Session[clsConstant.TOKEN]).Agency, folderPath + "\\" + fileName + ".pdf");
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }
                        Alert.show("Comments Sucessfully Saved");
                    }
                }

                // }
                else
                {
                    // int Eventid = Convert.ToInt32(ViewState["eventID"].ToString());
                    SaveComments(Convert.ToInt32(ViewState["EventId"].ToString()), fileName);
                    Alert.show("Comments send successfully");
                    btnReply.Visible = false;
                    try
                    {
                        string   nameOfSender = ((UserDetails)Session[clsConstant.TOKEN]).FirstName.ToString() + ' ' + ((UserDetails)Session[clsConstant.TOKEN]).LastName.ToString();
                        string[] sListToEmail = new string[lstToSelectedEmail.Items.Count + 1];  // before hre two

                        string emailAlert = string.Empty;
                        emailAlert = "";
                        int iloop;

                        for (iloop = 0; iloop < lstToSelectedEmail.Items.Count; iloop++)
                        {
                            sListToEmail[iloop] = lstToSelectedEmail.Items[iloop].Value;

                            string email  = lstToSelectedEmail.Items[iloop].Text;
                            int    getPos = email.IndexOf("),");
                            emailAlert += email.Substring(getPos + 2) + ';';
                        }
                        // if (ds.Tables[0].Rows.Count > 0)
                        //  {
                        // emailAlert += ds.Tables[0].Rows[0]["vsEmailID"].ToString() + ';';
                        sListToEmail[iloop] = getToUserEmail(ViewState["EventId"].ToString());
                        //  }


                        emailAlert += (((UserDetails)Session[clsConstant.TOKEN]).EmailID).ToString() + ';';
                        SendEmailForWorkshopReply(txtComments.Text, ViewState["EventId"].ToString(), ViewState["vsTopic"].ToString(), "Workshop Comment", emailAlert, nameOfSender,
                                                  ((UserDetails)Session[clsConstant.TOKEN]).Designation, ((UserDetails)Session[clsConstant.TOKEN]).Agency);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
            else
            {
                ModalPopupExtender1.Show();
                errormsg.Text = "<span style='color:red;'>Please Provide comments</span>";
            }
        }
コード例 #13
0
 protected void btnReply_Click(object sender, EventArgs e)
 {
     fillComboBox(ddlAgency);
     ddlAgency_SelectedIndexChanged(null, null);
     ModalPopupExtender1.Show();
 }
コード例 #14
0
    //    protected void Image_Click(object sender, ImageClickEventArgs e)
    //    {
    //        ImageButton4.ImageUrl = ((ImageButton)sender).ImageUrl;
    //    }
    //    protected void RepeaterImages_ItemCommand(object source, RepeaterCommandEventArgs e)
    //    {
    //        ImageButton imgButton = (ImageButton)e.Item.FindControl("Image");
    //        string url = imgButton.ImageUrl;
    //    }
    //    protected void RepeaterImages_ItemCreated(object sender, RepeaterItemEventArgs e)
    //    {

    //        ImageButton imagelist = (ImageButton)e.Item.FindControl("Image");
    //if ( imagelist != null )
    //{

    //imagelist.Click += new System.Web.UI.ImageClickEventHandler(this.imagelist_Click);
    //}
    //    }
    //    private void imagelist_Click(object sender, System.EventArgs e)
    //    {
    //        ImageButton imagelist = (ImageButton)sender;
    //        string imagesource = imagelist.ImageUrl;
    //        // do whatever ... change your big image and so on
    //    }
    protected void Image_Click1(object sender, ImageClickEventArgs e)
    {
        ImageButton4.ImageUrl = ((ImageButton)sender).ImageUrl;
        ModalPopupExtender1.Show();
    }
コード例 #15
0
 protected void Click_tambah(object sender, EventArgs e)
 {
     BindData1();
     ModalPopupExtender1.Show();
 }
コード例 #16
0
    protected void btnContact_Click(object sender, EventArgs e)
    {
        ModalPopupExtender1.Show();
        bool boolReturn = true;


        if (string.IsNullOrEmpty(cu_txtName.Text) && boolReturn)
        {
            cu_lblError.Text = "Please Enter Name";
            boolReturn       = false;
        }

        if ((string.IsNullOrEmpty(cu_txtEmail.Text) || !MessageClass.IsValid(cu_txtEmail.Text)) && boolReturn)
        {
            cu_lblError.Text = "Invalid Email";
            boolReturn       = false;
        }

        if (string.IsNullOrEmpty(cu_txtMessage.Text) && boolReturn)
        {
            cu_lblError.Text = "Please Enter Message";
            boolReturn       = false;
        }

        if (MessageClass.IsSpammer())
        {
            bool isHuman = cu_captchaBox.Validate(cu_txtCaptcha.Text);
            cu_txtCaptcha.Text = null;

            if (!isHuman)
            {
                if (string.IsNullOrEmpty(cu_txtName.Text))
                {
                    cu_lblError.Text = "Please Enter a Name!";
                    boolReturn       = false;
                }
                else if (string.IsNullOrEmpty(cu_txtEmail.Text))
                {
                    cu_lblError.Text = "Invalid Email";
                    boolReturn       = false;
                }
                else if (string.IsNullOrEmpty(cu_txtMessage.Text))
                {
                    cu_lblError.Text = "Please Enter Message";
                    boolReturn       = false;
                }
                else
                {
                    cu_lblError.Text = "Invalid Captcha!";
                }
                boolReturn = false;
            }
        }

        //if (!string.IsNullOrEmpty(txtName_CN.Text))
        //{
        //    lblError.Text = "Please Enter Glossary";
        //    boolReturn = false;
        //}

        if (boolReturn)
        {
            string strID = MessageClass.InsertFeedback(1, cu_txtName.Text, cu_txtEmail.Text, cu_txtMessage.Text, null, null);

            string body = "Users name: " + cu_txtName.Text + "\n\n";
            body += "Message: \n " + cu_txtMessage.Text + "\n\n";
            body += "Contact email: " + cu_txtEmail.Text;
            MessageClass.SendMail("New message from user! ", "*****@*****.**", body, false);


            cu_txtName.Enabled    = false;
            cu_txtEmail.Enabled   = false;
            cu_txtMessage.Enabled = false;
            cu_btnOkay.Enabled    = false;
            cu_txtCaptcha.Enabled = false;
            cu_lblError.Text      = "Thank You!";
        }
        else
        {
            TurnCapchaOnOff(MessageClass.IsSpammer());
        }
    }
コード例 #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.SelectedTab = tabID.tabLogbook;

        mfbChartTotals1.HistogramManager = LogbookEntryDisplay.GetHistogramManager(mfbLogbook1.Data, User.Identity.Name);  // do this every time.

        if (!IsPostBack)
        {
            ModalPopupExtender1.OnCancelScript = String.Format(CultureInfo.InvariantCulture, "javascript:document.getElementById('{0}').style.display = 'none';", pnlWelcomeNewUser.ClientID);

            if (Request.Cookies[MFBConstants.keyNewUser] != null && !String.IsNullOrEmpty(Request.Cookies[MFBConstants.keyNewUser].Value) || util.GetStringParam(Request, "sw").Length > 0 || Request.PathInfo.Contains("/sw"))
            {
                Response.Cookies[MFBConstants.keyNewUser].Expires = DateTime.Now.AddDays(-1);
                ModalPopupExtender1.Show();
            }

            rblTotalsMode.SelectedValue = mfbTotalSummary1.DefaultGroupMode.ToString(CultureInfo.InvariantCulture);

            // Handle a requested tab - turning of lazy load as needed
            string szReqTab = util.GetStringParam(Request, "ft");
            if (!String.IsNullOrEmpty(szReqTab))
            {
                if (Enum.TryParse <FlightsTab>(szReqTab, out FlightsTab ft))
                {
                    AccordionCtrl.SelectedIndex = (int)ft - 1;
                    switch (ft)
                    {
                    case FlightsTab.Currency:
                        apcCurrency_ControlClicked(apcCurrency, null);
                        break;

                    case FlightsTab.Totals:
                        apcTotals_ControlClicked(apcTotals, null);
                        break;

                    case FlightsTab.Analysis:
                        apcAnalysis_ControlClicked(apcAnalysis, null);
                        break;

                    default:
                        break;
                    }
                }
            }

            int idFlight = util.GetIntParam(Request, szParamIDFlight, LogbookEntry.idFlightNew);

            // Redirect to the non-querystring based page so that Ajax file upload works
            if (idFlight != LogbookEntry.idFlightNew)
            {
                string szNew = Request.Url.PathAndQuery.Replace(".aspx", String.Format(CultureInfo.InvariantCulture, ".aspx/{0}", idFlight)).Replace(String.Format(CultureInfo.InvariantCulture, "{0}={1}", szParamIDFlight, idFlight), string.Empty).Replace("?&", "?");
                Response.Redirect(szNew, true);
                return;
            }

            if (Request.PathInfo.Length > 0 && Int32.TryParse(Request.PathInfo.Substring(1), out int id))
            {
                idFlight = id;
            }

            SetUpForFlight(idFlight);

            InitializeRestriction();

            // Expand the New Flight box if we're editing an existing flight
            if (idFlight != LogbookEntry.idFlightNew || !String.IsNullOrEmpty(util.GetStringParam(Request, "src")))
            {
                AccordionCtrl.SelectedIndex = 0;
            }

            string szTitle = String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.LogbookForUserHeader, MyFlightbook.Profile.GetUser(User.Identity.Name).UserFullName);
            lblUserName.Text = Master.Title = szTitle;

            // See if we just entered a new flight and scroll to it as needed
            if (Session[keySessLastNewFlight] != null)
            {
                mfbLogbook1.ScrollToFlight((int)Session[keySessLastNewFlight]);
                Session[keySessLastNewFlight] = null;
            }
        }
    }
コード例 #18
0
        protected void OnEdit(object sender, EventArgs e)
        {
            GridViewRow row      = (sender as ImageButton).NamingContainer as GridViewRow;
            int         rowindex = (gvExcelFile.PageSize * gvExcelFile.PageIndex) + row.RowIndex;

            lblDatabasename.Text     = "";
            txtServerName.Text       = "";
            txtDBType.Text           = "";
            txtDBVersion.Text        = "";
            txtInScope.Text          = "";
            txtJustification.Text    = "";
            txtTechnicalContact.Text = "";
            txtDBInstance.Text       = "";
            txtDBServerName.Text     = "";
            txtDBSizeGB.Text         = "";
            txtDiscoverySource.Text  = "";
            txtEnvironment.Text      = "";
            txtComments.Text         = "";

            if (row.Cells[1].Text.Trim() != "&nbsp;")
            {
                lblDatabasename.Text = row.Cells[1].Text.Trim();
            }
            if (row.Cells[2].Text.Trim() != "&nbsp;")
            {
                txtServerName.Text = row.Cells[2].Text.Trim();
            }
            if (row.Cells[3].Text.Trim() != "&nbsp;")
            {
                txtDBType.Text = row.Cells[3].Text.Trim();
            }
            if (row.Cells[4].Text.Trim() != "&nbsp;")
            {
                txtDBVersion.Text = row.Cells[4].Text.Trim();
            }
            if (row.Cells[5].Text.Trim() != "&nbsp;")
            {
                txtInScope.Text = row.Cells[5].Text.Trim();
            }
            if (row.Cells[6].Text.Trim() != "&nbsp;")
            {
                txtJustification.Text = row.Cells[6].Text.Trim();
            }
            if (row.Cells[7].Text.Trim() != "&nbsp;")
            {
                txtTechnicalContact.Text = row.Cells[7].Text.Trim();
            }
            if (row.Cells[8].Text.Trim() != "&nbsp;")
            {
                txtDBInstance.Text = row.Cells[8].Text.Trim();
            }
            if (row.Cells[9].Text.Trim() != "&nbsp;")
            {
                txtDBServerName.Text = row.Cells[9].Text.Trim();
            }
            if (row.Cells[10].Text.Trim() != "&nbsp;")
            {
                txtDBSizeGB.Text = row.Cells[10].Text.Trim();
            }
            if (row.Cells[11].Text.Trim() != "&nbsp;")
            {
                txtDiscoverySource.Text = row.Cells[11].Text.Trim();
            }
            if (row.Cells[12].Text.Trim() != "&nbsp;")
            {
                txtEnvironment.Text = row.Cells[12].Text.Trim();
            }
            if (row.Cells[13].Text.Trim() != "&nbsp;")
            {
                txtComments.Text = row.Cells[13].Text.Trim();
            }

            ModalPopupExtender1.Show();
        }
コード例 #19
0
    protected void onclickHyperlinkRollNumber(object sender, EventArgs e)
    {
        Business   b = new Business();
        FileUpload f = new FileUpload();

        setModalWindow(sender, e);
        popup.Visible = true;
        ModalPopupExtender1.Show();
        int         Index     = ((GridViewRow)((sender as Control)).NamingContainer).RowIndex;
        HiddenField field     = GridView1.Rows[Index].FindControl("EmployeeCode") as HiddenField;
        Label       author    = GridView1.Rows[Index].FindControl("AuthorName") as Label;
        Label       orcid     = GridView1.Rows[Index].FindControl("ORCID") as Label;
        Label       scopusid  = GridView1.Rows[Index].FindControl("ScopusID") as Label;
        Label       scopusid2 = GridView1.Rows[Index].FindControl("ScopusID2") as Label;
        Label       scopusid3 = GridView1.Rows[Index].FindControl("ScopusID3") as Label;

        f = b.DomainSearch(field.Value);

        string[] domain_value = (f.Domain.Split(':'));

        for (int k = 0; k <= domain_value.GetUpperBound(0); k++)
        {
            if (domain_value[k] != "")
            {
                if (k == 0)
                {
                    textDomain.Text = domain_value[k];
                }
                else
                {
                    textDomain.Text = textDomain.Text + ":" + domain_value[k];
                }
            }
        }
        Session["sessiondomain"] = textDomain.Text;

        string[] area_value = (f.Area.Split(':'));

        for (int m = 0; m <= area_value.GetUpperBound(0); m++)
        {
            if (area_value[m] != "")
            {
                if (m == 0)
                {
                    textArea.Text = area_value[m];
                }
                else
                {
                    textArea.Text = textArea.Text + ":" + area_value[m];
                }
            }
        }
        Session["sessionarea"]   = textArea.Text;
        Session["KeywordAuthor"] = author.Text;
        Session["Employeecode"]  = field.Value;
        Session["ORCID"]         = orcid.Text;
        Session["ScopusID"]      = scopusid.Text;
        Session["ScopusID2"]     = scopusid2.Text;
        Session["ScopusID3"]     = scopusid3.Text;
        Session["EmployCodeForSessionParameter"] = field.Value;

        txtauthorname.Text   = Session["KeywordAuthor"].ToString();
        txtEmployeeCode.Text = Session["Employeecode"].ToString();
        txtOrcid.Text        = Session["ORCID"].ToString();
        txtScopusid.Text     = Session["ScopusID"].ToString();
        txtScopusid2.Text    = Session["ScopusID2"].ToString();
        txtScopusid3.Text    = Session["ScopusID3"].ToString();
    }
コード例 #20
0
 protected void btnAddNewBusinessUnit_Click(object sender, EventArgs e)
 {
     ModalPopupExtender1.Show();
 }
コード例 #21
0
 protected void fin_rst_Click(object sender, EventArgs e)
 {
     ModalPopupExtender1.Show();
     clr_popup();
     BindData();
 }
コード例 #22
0
 protected void lnkforgot_Click1(object sender, EventArgs e)
 {
     lblmsg.Text  = "";
     txtname.Text = "";
     ModalPopupExtender1.Show();
 }
コード例 #23
0
ファイル: Default.aspx.cs プロジェクト: cugarx/CSWProyect
 protected void btnAddBook_Click(object sender, EventArgs e)
 {
     ModalPopupExtender1.Show();
     lblError.Text = string.Empty;
 }
コード例 #24
0
 protected void Show_yesno(object sender, EventArgs e)
 {
     ModalPopupExtender1.Show();
 }
コード例 #25
0
 protected void btnNuevo_Click(object sender, EventArgs e)
 {
     hid.Value = "0";
     ModalPopupExtender1.Show();
 }
コード例 #26
0
ファイル: claim.aspx.cs プロジェクト: AlekseyHamov/dispokb
        protected void GridView_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            ClaimOneRow.DataBind();
            InsertButton.Visible          = false;
            UpdateButton.Visible          = true;
            StatusRadioButtonList.Visible = true;
            DeleteButton.Visible          = true;
            try
            {
                if (DropDownListBuildingUpdate.Items.Count != 0)
                {
                    TextBox2.Text = ClaimOneRow.Rows[6].Cells[1].Text;
                }
                if (DropDownListBuildingUpdate.Items.Count != 0)
                {
                    DropDownListBuildingUpdate.SelectedValue = ClaimOneRow.Rows[2].Cells[1].Text;
                }
                if (DropDownListOtdelenUpdate.Items.Count != 0)
                {
                    DropDownListOtdelenUpdate.SelectedValue = ClaimOneRow.Rows[1].Cells[1].Text;
                }
                if (DropDownListRoomUpdate.Items.Count != 0)
                {
                    DropDownListRoomUpdate.SelectedValue = ClaimOneRow.Rows[3].Cells[1].Text;
                }
                if (DropDownListPersonUpdate.Items.Count != 0)
                {
                    DropDownListPersonUpdate.SelectedValue = ClaimOneRow.Rows[4].Cells[1].Text;
                }
                if (RadioButtonUnitUpdate.Items.Count != 0)
                {
                    RadioButtonUnitUpdate.SelectedValue = ClaimOneRow.Rows[5].Cells[1].Text;
                }
            }
            catch { }
            ListClaimSpares.DataBind();
            CheckBoxDevice.DataBind();
            for (int i = 0; i < CheckBoxDevice.Items.Count; i++)
            {
                for (int j = 0; j < ListClaimSpares.Rows.Count; j++)
                {
                    if (ListClaimSpares.Rows[j].Cells[3].Text == CheckBoxDevice.Items[i].Value)
                    {
                        if (Convert.ToInt32(ListClaimSpares.Rows[j].Cells[3].Text) != 0)
                        {
                            CheckBoxDevice.Items[i].Selected = true;
                        }
                    }
                }
            }
            string ID_Device = "0";

            for (int i = 0; i < CheckBoxDevice.Items.Count; i++)
            {
                if (CheckBoxDevice.Items[i].Selected == true)
                {
                    ID_Device += ", " + CheckBoxDevice.Items[i].Value;
                }
            }
            try
            {
                SparesObjectDataSource.FilterParameters.Clear();
                SparesObjectDataSource.FilterParameters.Add("ID_Device", ID_Device);
            }
            catch (FormatException) { }
            CheckBoxSpares.DataBind();
            for (int i = 0; i < CheckBoxSpares.Items.Count; i++)
            {
                for (int j = 0; j < ListClaimSpares.Rows.Count; j++)
                {
                    if (ListClaimSpares.Rows[j].Cells[2].Text == CheckBoxSpares.Items[i].Value)
                    {
                        if (Convert.ToInt32(ListClaimSpares.Rows[j].Cells[2].Text) != 0)
                        {
                            CheckBoxSpares.Items[i].Selected = true;
                        }
                    }
                }
            }

            ModalPopupExtender1.Show();
        }
コード例 #27
0
ファイル: Default.aspx.cs プロジェクト: hprakashsingh/EAPDEA
    protected void PPRDetailsGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "ViewPpr")
        {
            try
            {
                string PprId = e.CommandArgument.ToString();
                string url   = "../LinMin/PprPreview.aspx?PPRID=" + PprId;
                ClientScript.RegisterStartupScript(this.GetType(), "newWindow", String.Format("<script>var myPopup = window.open('{0}', 'Cliente','width=1100,height=700,left=200,top=50,resizable=yes', 'true');if(!myPopup)alert('a popup was blocked. please enable pop setting on brower');</script>", url));
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
        }
        if (e.CommandName == "EditPpr")
        {
            //Determine the RowIndex of the Row whose Button was clicked.
            int rowIndex = Convert.ToInt32(e.CommandArgument);

            //Reference the GridView Row.
            GridViewRow row = PPRDetailsGridView.Rows[rowIndex];

            //Fetch value of Name.
            string PPRId = (row.FindControl("lnkPPRId") as LinkButton).Text;

            Session["PprEditId"] = PPRId;
            Response.Redirect("PprOneEdit.aspx");
            Session["ButtonHide"] = "SavePPr";
        }
        if (e.CommandName == "DeletePpr")
        {
            //Determine the RowIndex of the Row whose Button was clicked.
            int rowIndex = Convert.ToInt32(e.CommandArgument);

            //Reference the GridView Row.
            GridViewRow row = PPRDetailsGridView.Rows[rowIndex];

            //Fetch value of Name.
            string PPRId = (row.FindControl("lnkPPRId") as LinkButton).Text;

            try
            {
                PPRDataBL obj = new PPRDataBL();
                DataTable dt  = new DataTable();
                int       success;
                obj     = new PPRDataBL();
                success = obj.DeletePPrDataBL(PPRId);
                DisplayPPRDetails();
                if (success > 0)
                {
                    Alert.show("Record has been deleted successfully!");
                }
                DisplayPPRDetails();
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
        }
        if (e.CommandName == "ProposalPreview")
        {
            ViewState["PPRId"] = e.CommandArgument.ToString();
            PPRDataBL obj = new PPRDataBL();
            DataTable dt  = new DataTable();
            dt = obj.GetFinalPprDocDataBL(HttpUtility.HtmlEncode(ViewState["PPRId"].ToString()));
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["RelevantDocumentOne"].ToString() == null || dt.Rows[0]["RelevantDocumentOne"].ToString() == "" || dt.Rows[0]["RelevantDocumentOne"].ToString() == "N")
                {
                    Label9.Text = "File Not available";
                    btnRelevantDocumentTwo.Visible = false;
                    RD2.Visible = false;
                }
                else
                {
                    btnRelevantDocumentTwo.CommandArgument = dt.Rows[0]["RelevantDocumentOne"].ToString();
                    btnRelevantDocumentTwo.Visible         = true;
                }
                if (dt.Rows[0]["RelevantDocumentTwo"].ToString() == null || dt.Rows[0]["RelevantDocumentTwo"].ToString() == "" || dt.Rows[0]["RelevantDocumentTwo"].ToString() == "N")
                {
                    Label10.Text = "File Not available";
                    btnRelevantDocumentThree.Visible = false;
                    RD3.Visible = false;
                }
                else
                {
                    btnRelevantDocumentThree.CommandArgument = dt.Rows[0]["RelevantDocumentTwo"].ToString();
                    btnRelevantDocumentThree.Visible         = true;
                }
                if (dt.Rows[0]["TechnicalDocument"].ToString() == "NA" || dt.Rows[0]["TechnicalDocument"].ToString() == "" || dt.Rows[0]["TechnicalDocument"].ToString() == "N")
                {
                    Label2.Text = "File Not available";
                    lnkTechnicalDocument.Visible = false;
                    Sd.Visible = false;
                }
                else
                {
                    lnkTechnicalDocument.CommandArgument = dt.Rows[0]["TechnicalDocument"].ToString();
                    lblpd.Text = "";
                    lnkTechnicalDocument.Visible = true;
                }
                //if (dt.Rows[0]["DebtSustCert"].ToString() == "NA")
                //{
                //    lnkpd.Visible = false;
                //    lblpd.Text = "File Not available";
                //}
                //else
                //{
                //    lnkpd.CommandArgument = dt.Rows[0]["DebtSustCert"].ToString();
                //    lblpd.Text = "";
                //    lnkpd.Visible = true;
                //}
                if (dt.Rows[0]["PrevPhase"].ToString() == "NA")
                {
                    lnkPPD.Visible = false;
                    lblPPD.Text    = "File Not available";
                    PP.Visible     = false;
                }
                else
                {
                    lnkPPD.CommandArgument = dt.Rows[0]["PrevPhase"].ToString();
                    lblPPD.Text            = "";
                    lnkPPD.Visible         = true;
                }
                //if (dt.Rows[0]["StaClearance"].ToString() == "NA")
                //{
                //    lnkSc.Visible = false;
                //    lblSc.Text = "File Not available";
                //}
                //else
                //{
                //    lnkSc.Visible = true;
                //    lblSc.Text = "";
                //    lnkSc.CommandArgument = dt.Rows[0]["StaClearance"].ToString();
                //}
                if (dt.Rows[0]["RevisedPpr"].ToString() == "RP")
                {
                    RPpr.Visible = true;
                }
                else
                {
                    RPpr.Visible = false;
                }
                if (dt.Rows[0]["DefermentPpr"].ToString() == "DP")
                {
                    DPpr.Visible = true;
                }
                else
                {
                    DPpr.Visible = false;
                }
            }
            ModalPopupExtender1.Show();
        }
    }
コード例 #28
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        //Label1.Text = Session["b1"].ToString ();

        string day     = DrpDay.Text;
        int    period  = Convert.ToInt32(DrpPeriod.Text);
        string course  = DrpCourse.SelectedValue;
        string sub     = LblSCode.Text;
        string teacher = LblTeacher.Text;
        string room    = DrpRoom.SelectedValue;
        string sn      = findSName(sub);

        ////start:
        try
        {
            if (sn != "LAB")
            {
                cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Subject='" + sub + "' and Course='" + course + "'", con);
                //con.Open();
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    dr.Close();
                    con.Close();

                    Response.Write("<script>alert('Second Class for this subject can not be scheduled on the same day. ')</script>");
                    //return;
                    goto end;
                }
                else
                {
                    dr.Close();
                    con.Close();
                }

                cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Period='" + period + "' and Course='" + course + "'", con);
                //con.Open();
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    dr.Close();
                    con.Close();
                    //
                    Response.Write("<script>alert('Another Class exits.Please Select Carefully. ')</script>");
                    ModalPopupExtender1.Show();
                    //return;
                    goto end;
                }
                else
                {
                    dr.Close();
                    con.Close();
                }


                //check for if a teacher is having more than two classes in a day
                cmd = new SqlCommand("Select count(Ttid) from TimeTable where Day='" + day + "' and Teacher='" + teacher + "' having count(Ttid)>=2", con);
                //con.Open();
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    dr.Close();
                    con.Close();
                    //
                    Response.Write("<script>alert('Sorry, the teacher has already two classes that day. ')</script>");
                    ModalPopupExtender1.Show();
                    //return;
                    goto end;
                }
                else
                {
                    dr.Close();
                    con.Close();
                }

                //        //check for if a teacher is having more than four classes for the course
                //        cmd = new SqlCommand("Select Count(Ttid) from TimeTable where Teacher='" + teacher + "' and Course='" + course + "' having count(Ttid) >=4", con);
                //        if (con.State == ConnectionState.Closed)
                //        {
                //            con.Open();
                //        }
                //        dr = cmd.ExecuteReader();
                //        if (dr.Read())
                //        {
                //            dr.Close();
                //            con.Close();
                //            //goto end;
                //            Response.Write("<script>alert('This Subject has already four classes scheduled. ')</script>");
                //            return;
                //        }
                //        else
                //        {
                //            dr.Close();
                //            con.Close();
                //        }

                //check for if a teacher is having class clashes
                //cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Period='" + period + "' and Teacher='" + teacher + "'", con);
                ////con.Open();
                //if (con.State == ConnectionState.Closed)
                //{
                //    con.Open();
                //}
                //dr = cmd.ExecuteReader();
                //if (dr.Read())
                //{
                //    dr.Close();
                //    con.Close();
                //    //
                //    Response.Write("<script>alert('Teacher's Class is clashing... ')</script>");
                //    ModalPopupExtender1.Show();
                //    //return;
                //    goto end;
                //}
                //else
                //{
                //    dr.Close();
                //    con.Close();
                //}
                //check for if a room is having  clashes
                //cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Period='" + period + "' and Room='" + room + "'", con);
                ////con.Open();
                //if (con.State == ConnectionState.Closed)
                //{
                //    con.Open();
                //}
                //dr = cmd.ExecuteReader();
                //if (dr.Read())
                //{
                //    dr.Close();
                //    con.Close();
                //    //
                //    Response.Write("<script>alert('This Room is alredy used.. ')</script>");
                //    ModalPopupExtender1.Show();
                //    //return;
                //    goto end;
                //}
                //else
                //{
                //    dr.Close();
                //    con.Close();
                //}
                cmd = new SqlCommand("Insert Into TimeTable Values('" + day + "','" + period + "', '" + sub + "','" + room + "','" + teacher + "','" + course + "')", con);
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                int n = cmd.ExecuteNonQuery();
                cmd = new SqlCommand("Delete from TimeTable  Where Course like '%" + DrpCourse.SelectedValue + "%' and Day='" + Session["b4"] + "' and Period='" + Session["b3"] + "' and Subject='" + Session["b1"] + "' and Room='" + Session["b5"] + "' and Teacher='" + Session["b2"] + "'  ", con);
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.ExecuteNonQuery();
                con.Close();
            }

            if (sn == "LAB")
            {
                cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Period='" + period + "' and Course='" + course + "'", con);
                //con.Open();
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    dr.Close();
                    con.Close();
                    //
                    Response.Write("<script>alert('Another Class exits.Please Select Carefully. ')</script>");
                    ModalPopupExtender1.Show();
                    //return;
                    goto end;
                }
                else
                {
                    dr.Close();
                    con.Close();
                }
                cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Period='" + period + "' and Teacher='" + teacher + "'", con);
                //con.Open();
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    dr.Close();
                    con.Close();
                    //
                    Response.Write("<script>alert('Teacher's Class is clashing... ')</script>");
                    ModalPopupExtender1.Show();
                    //return;
                    goto end;
                }
                else
                {
                    dr.Close();
                    con.Close();
                }
                if (period != 6)
                {
                    cmd = new SqlCommand("Select Ttid from TimeTable where Day='" + day + "' and Period=" + (period + 1) + " and Course='" + course + "'", con);
                    //con.Open();
                    if (con.State == ConnectionState.Closed)
                    {
                        con.Open();
                    }
                    dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        dr.Close();
                        con.Close();
                        Response.Write("<script>alert('Two consecutive periods are not available ')</script>");
                        ModalPopupExtender1.Show();
                        goto end;
                    }
                    else
                    {
                        dr.Close();
                        cmd = new SqlCommand("insert into TimeTable values('" + day + "','" + period + "','" + sub + "','" + room + "','" + teacher + "','" + course + "')", con);
                        cmd.ExecuteNonQuery();
                        cmd = new SqlCommand("insert into TimeTable values('" + day + "','" + (period + 1) + "','" + sub + "','" + room + "','" + teacher + "','" + course + "')", con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                        cmd = new SqlCommand("Delete from TimeTable  Where Course like '%" + DrpCourse.SelectedValue + "%' and Day='" + Session["b4"] + "' and Period='" + Session["b3"] + "' and Subject='" + Session["b1"] + "' and Room='" + Session["b5"] + "' and Teacher='" + Session["b2"] + "'  ", con);
                        if (con.State == ConnectionState.Closed)
                        {
                            con.Open();
                        }
                        cmd.ExecuteNonQuery();
                        con.Close();
                        int p = Convert.ToInt32(Session["b3"]);
                        p = p + 1;
                        con.Open();
                        cmd = new SqlCommand("Delete from TimeTable  Where Course like '%" + DrpCourse.SelectedValue + "%' and Day='" + Session["b4"] + "' and Period='" + p + "' and Subject='" + Session["b1"] + "' and Room='" + Session["b5"] + "' and Teacher='" + Session["b2"] + "'  ", con);
                        cmd.ExecuteNonQuery();
                        con.Close();
                        //Response.Write("<script>alert('Saved successfully')</script>");
                        //goto start;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            dr.Close();
            con.Close();
        }
        viewTimeTable();
        DrpPeriod.Visible = false;
        DrpRoom.Visible   = false;
        TxtPeriod.Visible = true;
        TxtRoom.Visible   = true;
end:
        return;
    }
コード例 #29
0
        protected void btnBulkInv_Click(object sender, EventArgs e)
        {
            CreamBell_DMS_WebApps.App_Code.Global obj = new App_Code.Global();
            SqlConnection con = obj.GetConnection();
            SqlCommand    cmd = new SqlCommand();

            cmd.CommandType    = CommandType.Text;
            cmd.CommandTimeout = 3600;
            try
            {
                int    count    = 0;
                string SO_NO    = string.Empty;
                string custname = string.Empty;
                foreach (GridViewRow rw in gvHeader.Rows)
                {
                    CheckBox chkBx       = (CheckBox)rw.FindControl("chkSONO");
                    Label    lblCustName = (Label)rw.FindControl("Customer_Name");


                    if (chkBx != null && chkBx.Checked)
                    {
                        count += 1;
                        int row = rw.RowIndex;

                        custname = lblCustName.Text;
                        LinkButton lblSOno = (LinkButton)gvHeader.Rows[row].FindControl("lnkbtn");
                        Label      lblinv  = (Label)gvHeader.Rows[row].FindControl("Invoice_No");
                        if (lblSOno.Text != "")
                        {
                            if (lblinv.Text == "")
                            {
                                SO_NO += "" + lblSOno.Text + ",";
                            }
                        }
                    }

                    lblMessge.Text = "";
                }
                if (count > 8)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerts", "alert('Maximum 8 sale order selected in single bulk invoice generation');", true);
                    return;
                }
                SO_NO           = SO_NO.Remove(SO_NO.Length - 1);
                cmd.Connection  = con;
                cmd.CommandText = "EXEC AX.ACX_SOTOINVOICECREATION_BULK '" + Session["TransLocation"] + "','" + Session["SiteCode"] + "','" + SO_NO + "'";
                DataTable dt = new DataTable();
                dt.Load(cmd.ExecuteReader());
                gridviewRecords.DataSource = dt;
                gridviewRecords.Visible    = true;
                gridviewRecords.DataBind();
                ModalPopupExtender1.Show();
                ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", "javascript:MyMessage(" + dt.Rows.Count + "," + dt.Select("Remarks='Success'").Count() + ");", true);
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "javascript:MyMessage("+dt.Rows.Count+","+dt.Select("Remarks='Success'").Count() +");", true);
                //Response.Write("<script>alert('test');</script>");
                //ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", "alert('test');", true);
            }
            catch (Exception ex)
            {
                ErrorSignal.FromCurrentContext().Raise(ex);
            }
        }