예제 #1
0
    protected void ChekAll_Click(object sender, EventArgs e)
    {
        try
        {
            int   i   = 0;
            Table TBL = new Table();
            TBL = (Table)(Session["itemINoRDER"]);
            int num = TBL.Rows.Count;
            foreach (TableRow x in TBL.Rows)
            {
                if (i < num - 1)
                {
                    CheckBox itemBox = divOrder.FindControl("ChekBox" + i.ToString()) as CheckBox;
                    itemBox.Checked = true;
                    i++;
                }
            }
            DBservices dbs            = new DBservices();
            string     NumberDelivery = TBDelivery.Text;
            string     sup_date       = TBdate.Text;

            //dbs.UpDateOrder(NumberOrder, "close", NumberDelivery, sup_date);
            //Response.Redirect("OrderList.aspx", false);
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #2
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        try
        {
            int   i   = 0;
            Table TBL = new Table();
            TBL = (Table)(Session["MessageTbl"]);
            int num = TBL.Rows.Count;

            foreach (TableRow x in TBL.Rows)
            {
                if (((x.Cells[1].Text) != "הודעות") && (i < num - 1))
                {
                    CheckBox itemBox = divmessage.FindControl("ChekBox" + i.ToString()) as CheckBox;
                    i++;
                    if (itemBox.Checked == true)
                    {
                        DBservices.DeleteMessage(x.Cells[1].Text);
                    }
                }
            }
            Response.Redirect("message.aspx");
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
        /// <summary>
        /// actualiza tabla evaluacion conceptos
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="Nombre"></param>
        public void modificar(Int32 Id, String Nombre)
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
            SqlCommand    cmd  = new SqlCommand("Update EvaluacionConceptos set NomEvaluacionConceptos ='" + Nombre + "' WHERE Id_EvaluacionConceptos=" + Id, conn);

            try
            {
                conn.Open();
                cmd.ExecuteReader();
            }
            catch (SqlException ex)
            {
                string url = Request.Url.ToString();

                string mensaje        = ex.Message.ToString();
                string data           = ex.Data.ToString();
                string stackTrace     = ex.StackTrace.ToString();
                string innerException = ex.InnerException == null ? "" : ex.InnerException.Message.ToString();

                // Log the error
                ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, "catalogoEvaluacionConceptos", "CatalogoEvaluacionConceptos");
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
예제 #4
0
        public ReturnObject FindDoctorsByString(string str = "")
        {
            ReturnObject returnData = new ReturnObject();

            try
            {
                using (var db = new ddiarydbEntities())
                {
                    var list     = new List <DoctorViewModel>();
                    var datalist = (from doc in db.Doctor_Master
                                    where doc.IsActive == true && doc.Doctor_name.ToLower().StartsWith(str.ToLower())
                                    select doc).ToList();

                    returnData.message     = "Successfull";
                    returnData.status_code = Convert.ToInt32(Status.Sucess);
                    returnData.data1       = datalist;
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message, ex);
                returnData.data1       = ex;
                returnData.message     = "Oops something went wrong! ";
                returnData.status_code = Convert.ToInt32(Status.Failed);
            }

            return(returnData);
        }
        /// <summary>
        /// Eliminar EvaluacionConceptos.
        /// </summary>
        /// <param name="Id">The identifier.</param>
        public void eliminar(int Id)
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
            SqlCommand    cmd  = new SqlCommand("DELETE FROM EvaluacionConceptos WHERE Id_EvaluacionConceptos=" + Id, conn);

            try
            {
                conn.Open();
                cmd.ExecuteReader();
            }
            catch (SqlException se)
            {
                string url = Request.Url.ToString();

                string mensaje        = se.Message.ToString();
                string data           = se.Data.ToString();
                string stackTrace     = se.StackTrace.ToString();
                string innerException = se.InnerException == null ? "" : se.InnerException.Message.ToString();

                // Log the error
                ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, "catalogoEvaluacionConceptos", "catalogoEvaluacionConceptos");
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
예제 #6
0
        public ReturnObject Get_DoctorBookedSlot(int id, DateTime DATE)
        {
            ReturnObject returnData = new ReturnObject();

            try
            {
                using (var db = new ddiarydbEntities())
                {
                    if (id > 0)
                    {
                        var bookedSlot = (from a in db.Appointments
                                          where a.DoctorId == id && (a.DateStart.Day == DATE.Day) && (a.DateStart.Month == DATE.Month) && (a.DateStart.Year == DATE.Year)
                                          select a.SessionId).ToList();

                        returnData.message     = "Successfull";
                        returnData.status_code = Convert.ToInt32(Status.Sucess);
                        returnData.data1       = bookedSlot;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message, ex);
                returnData.data1       = ex;
                returnData.message     = "Oops something went wrong! ";
                returnData.status_code = Convert.ToInt32(Status.Failed);
            }

            return(returnData);
        }
예제 #7
0
    protected void ButtonPatient_Click(object sender, EventArgs e)
    {
        DBservices dbs = new DBservices();

        try
        {
            NameValueCollection coll = Request.QueryString;
            string ID     = coll["P_id"];
            string Kupah  = (DDPatientKupah.SelectedItem).ToString();
            string Zantar = (DDPatientZantar.SelectedItem).ToString();

            if (Zantar == "כן")
            {
                Zantar = "1";
            }
            else
            {
                Zantar = "0";
            }

            string needle      = (DDneedle.SelectedItem).ToString();
            string coil        = (DDcoil.SelectedItem).ToString();
            string infusionBag = (DDinfusionBag.SelectedItem).ToString();
            string solutions   = (DDsolutions.SelectedItem).ToString();

            dbs.UpDatePatient(ID, Kupah, Zantar, needle, coil, infusionBag, solutions);
            Response.Redirect("PatientList.aspx");
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("קיימת בעיה אנא נסה שנית מאוחר יותר");
        }
    }
예제 #8
0
        public ReturnObject Get_Doctor(int id)
        {
            ReturnObject returnData = new ReturnObject();

            try
            {
                using (var db = new ddiarydbEntities())
                {
                    Doctor_Master doctor = db.Doctor_Master.Where(x => x.Doctor_id == id).FirstOrDefault();

                    returnData.message     = "Successfull";
                    returnData.status_code = Convert.ToInt32(Status.Sucess);
                    returnData.data1       = doctor;
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message, ex);
                returnData.data1       = ex;
                returnData.message     = "Oops something went wrong! ";
                returnData.status_code = Convert.ToInt32(Status.Failed);
            }

            return(returnData);
        }
예제 #9
0
        /// <summary>
        /// Handles the Selecting event of the lds_listadoProyXConvoct control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="LinqDataSourceSelectEventArgs"/> instance containing the event data.</param>
        protected void lds_listadoProyXConvoct_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            try
            {
                var query = from P in consultas.MostrarProyectosPorConvocatoria(idConvocatoria)
                            select P;
                e.Arguments.TotalRowCount = query.Count();

                query = query.Skip(GridViewConvoct.PageIndex * PAGE_SIZE).Take(PAGE_SIZE);

                e.Result = query;
            }
            catch (Exception ex)
            {
                string url = Request.Url.ToString();

                string mensaje        = ex.Message.ToString();
                string data           = ex.Data.ToString();
                string stackTrace     = ex.StackTrace.ToString();
                string innerException = ex.InnerException == null ? "" : ex.InnerException.Message.ToString();

                // Log the error
                ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, usuario.Email, usuario.IdContacto.ToString());
            }
        }
예제 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DDL = new DropDownList();
            ListItem      item     = new ListItem();
            DBservices    dbs      = new DBservices();
            List <string> itemList = new List <string>();
            itemList = dbs.getVendorName();
            DDL.Items.Add(" ");
            foreach (string name in itemList)
            {
                DDL.Items.Add(name);
            }



            DDL.SelectedIndexChanged += new EventHandler(dynamicDDL_SelectedIndexChanged);

            VendorDDL.Controls.Add(DDL);
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #11
0
    protected void BforgotPASS_Click(object sender, EventArgs e)
    {
        DBservices dbs = new DBservices();

        try
        {
            bool iswork = dbs.chekID(TBIDworker.Text);

            if (iswork == true)
            {
                List <string> WorkerDetails = new List <string>();
                WorkerDetails = DBservices.GetWorkerDetails(TBIDworker.Text);

                Mailmsg.Send("Your password is: " + WorkerDetails[1].ToString(), " password", WorkerDetails[2].ToString());

                LBans.ForeColor = System.Drawing.ColorTranslator.FromHtml("#9b8d84");
                LBans.Text      = " סיסמא נשלחה ל: " + WorkerDetails[0].ToString();
                HyperLink link = new HyperLink();
                link.NavigateUrl = "Default.aspx";
                link.Text        = "חזרה לדף הכניסה";
                LBbeack.Controls.Add(link);
            }
            else
            {
                LBans.ForeColor = System.Drawing.Color.Red;
                LBans.Text      = "תעודת הזהות שהוקשה אינה קיימת במערכת - הכנס תעודת זהות שוב או פנה למנהל מערכת";
            }
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("קיימת בעיה אנא נסה שנית מאוחר יותר");
        }
    }
예제 #12
0
        /// <summary>
        /// actualizacion evaluacion conceptos
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void B_Nuevo_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
            SqlCommand    cmd  = new SqlCommand("INSERT INTO EvaluacionConceptos (NomEvaluacionConceptos) VALUES ('" + TB_Nuevo.Text + "')", conn);

            try
            {
                conn.Open();
                cmd.ExecuteReader();
            }
            catch (SqlException ex)
            {
                string url = Request.Url.ToString();

                string mensaje        = ex.Message.ToString();
                string data           = ex.Data.ToString();
                string stackTrace     = ex.StackTrace.ToString();
                string innerException = ex.InnerException == null ? "" : ex.InnerException.Message.ToString();

                // Log the error
                ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, "CatalogoEvaluacionConceptosAdicionar", "CatalogoEvaluacionConceptosAdicionar");
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }

            Response.Redirect("CatalogoEvaluacionConceptos.aspx");
        }
예제 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int runNum = 0;

        try
        {
            DropDownList DDL = sender as DropDownList;
            DBservices   dbs = new DBservices();

            List <Message> ListMessage = new List <Message>();
            Table          MessageTbl  = new Table();

            ListMessage = dbs.ReadMessage();

            MessageTbl.Attributes.Add("class", "CSSTableGenerator");

            TableRow CRow = new TableRow();

            TableCell CHEAKCell = new TableCell();
            CHEAKCell.Text = "סימון למחיקה";
            CRow.Cells.Add(CHEAKCell);


            TableCell MessageCell = new TableCell();
            MessageCell.Text = "הודעות";
            CRow.Cells.Add(MessageCell);

            MessageTbl.Rows.Add(CRow);


            foreach (Message x in ListMessage)
            {
                TableRow tRow = new TableRow();

                TableCell ChekCell = new TableCell();
                CheckBox  ChekItem = new CheckBox();
                ChekItem.ID = "ChekBox" + (runNum++).ToString();
                ChekCell.Controls.Add(ChekItem);
                tRow.Cells.Add(ChekCell);


                TableCell textCell = new TableCell();
                textCell.Text = x.Text_message;
                tRow.Cells.Add(textCell);


                MessageTbl.Rows.Add(tRow);
            }

            divmessage.Controls.Add(MessageTbl);
            Session["MessageTbl"] = MessageTbl;
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #14
0
        private SqlDataReader ejecutaReader(String sql, int obj)
        {
            SqlDataReader reader = null;

            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
            SqlCommand    cmd  = new SqlCommand(sql, conn);

            try
            {
                if (reader != null)
                {
                    if (!reader.IsClosed)
                    {
                        reader.Close();
                    }
                }

                if (conn != null)
                {
                    conn.Close();
                }

                conn.Open();

                if (obj == 1)
                {
                    reader = cmd.ExecuteReader();
                }
                else
                {
                    cmd.ExecuteReader();
                }
            }
            catch (SqlException ex)
            {
                string url = Request.Url.ToString();

                string mensaje        = ex.Message.ToString();
                string data           = ex.Data.ToString();
                string stackTrace     = ex.StackTrace.ToString();
                string innerException = ex.InnerException == null ? "" : ex.InnerException.Message.ToString();

                // Log the error
                ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, usuario.Email, usuario.IdContacto.ToString());

                if (conn != null)
                {
                    conn.Close();
                }
                return(null);
            }
            finally {
                conn.Close();
                conn.Dispose();
            }

            return(reader);
        }
예제 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string id = Request.QueryString["id"];

            DataTable        dt   = new DataTable();
            DBservices       dbs  = new DBservices();
            List <ItemInINV> list = new List <ItemInINV>();
            int Disc = 0;


            int Sum = dbs.GetTotSum(id);
            list = dbs.GetITEMINV(ID);

            LBLsum.Text = Sum.ToString() + "  :סכום";

            dt.Columns.Add("Reason");
            dt.Columns.Add("SN");
            dt.Columns.Add("Credit");


            foreach (ItemInINV x in list)
            {
                DataRow row = dt.NewRow();

                row[0] = "חיוב זיכוי";
                row[1] = x.Sn;
                row[2] = ((x.It_price - x.Inv_price) * x.Inv_quant);

                dt.Rows.Add(row);

                Disc += Convert.ToInt32(row[2]);
            }

            GV_PayTBL.DataSource = dt;
            GV_PayTBL.DataBind();

            //DataGrid DG = new DataGrid();
            //DG.DataSource = dt;
            //DG.DataBind();

            //Mailmsg msg = new Mailmsg();
            //string Body = msg.RenderControl(DG);

            //msg.Send(Body, "חשבונית");


            LBLdis.Text = (Sum + Disc).ToString() + " :סכום לאחר זיכוי";
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #16
0
    protected void Approval_Click(object sender, EventArgs e)
    {
        try
        {
            string NumberDelivery = TBDelivery.Text;


            int        i        = 0;
            int        numcheck = 0;
            DBservices dbs      = new DBservices();
            Table      TBL      = new Table();
            TBL = (Table)(Session["itemINoRDER"]);
            int num = TBL.Rows.Count;

            foreach (TableRow x in TBL.Rows)
            {
                if (TBL.Rows.GetRowIndex(x) != 0)
                {
                    if (i < num - 1)
                    {
                        CheckBox itemBox = divOrder.FindControl("ChekBox" + i.ToString()) as CheckBox;
                        i++;
                        if (itemBox.Checked == true)
                        {
                            numcheck++;
                            DBservices.AprroveItem(NumberOrder, x.Cells[2].Text);
                        }
                    }
                }
            }


            // string sup_date = ShippingDateCalendar.SelectedDate.ToShortDateString();
            string sup_date = TBdate.Text;

            if (numcheck == count)
            {
                dbs.UpDateOrder(NumberOrder, "close", NumberDelivery, sup_date);
            }
            else
            {
                dbs.UpDateOrder(NumberOrder, "partially approved", NumberDelivery, sup_date);
            }

            Response.Redirect("OrderList.aspx", false);
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #17
0
 protected void CreateReport(object sender, EventArgs e)
 {
     try
     {
         string ID = (string)(Session["id"]);
         Response.Redirect("Teva_Pay.aspx?ID=" + ID, false);
     }
     catch (Exception ex)
     {
         ErrHandler.WriteError(ex.Message);
         Response.Write("ארעה שגיאה");
     }
 }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            NameValueCollection coll = Request.QueryString;
            string ItemName          = coll["Name"];

            List <string> listItem = new List <string>();
            DBservices    dbs      = new DBservices();

            listItem = dbs.getItemBYsn(ItemName);

            Label lbName = new Label();
            lbName.Text = listItem[0].ToString();
            PHIteamName.Controls.Add(lbName);


            Label lbSN = new Label();
            lbSN.ID   = "lbSN";
            lbSN.Text = listItem[1].ToString();
            PHIteamNS.Controls.Add(lbSN);

            Label lbCatgory = new Label();
            lbCatgory.Text = listItem[2].ToString();
            PHIteamCatgory.Controls.Add(lbCatgory);



            Label lbNumInBox = new Label();
            lbNumInBox.ForeColor = System.Drawing.Color.Red;
            lbNumInBox.Text      = "הכמות הנוכחית לאריזה  : " + listItem[3].ToString();
            PHNumInBox.Controls.Add(lbNumInBox);

            Label lbPrice = new Label();
            lbPrice.ForeColor = System.Drawing.Color.Red;
            lbPrice.Text      = "המחיר הנוכחי : " + listItem[4].ToString();
            PHTBPrice.Controls.Add(lbPrice);

            Label lbvandor = new Label();
            lbvandor.Text = listItem[5].ToString();
            PHIteamVandor.Controls.Add(lbvandor);
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #19
0
    protected void goToitemOrder(object sender, EventArgs e)
    {
        try
        {
            string OrderDate = TBdate.Text;
            //OrderDateCalendar.SelectedDate.ToShortDateString();
            Session["OrderDate"] = OrderDate;

            Response.Redirect("../Item/itemOrder.aspx", false);
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #20
0
        void Application_Error(object sender, EventArgs e)

        {
            //Code that runs when an unhandled error occurs
            Exception objErr = Server.GetLastError().GetBaseException();

            string url = Request.Url.ToString();

            string mensaje        = objErr.Message.ToString();
            string data           = objErr.Data.ToString();
            string stackTrace     = objErr.StackTrace.ToString();
            string innerException = objErr.InnerException == null ? "" : objErr.InnerException.Message.ToString();

            // Log the error
            ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, Usuario.Email, Usuario.IdContacto.ToString());
        }
예제 #21
0
        public ReturnObject FindPatientByMobile(string mobile = "")
        {
            ReturnObject returnData = new ReturnObject();

            if (mobile.Length == 10)
            {
                try
                {
                    using (var db = new ddiarydbEntities())
                    {
                        var patient = (from x in db.Patient_Master
                                       where x.Patient_contact == mobile
                                       select x).FirstOrDefault();

                        if (patient != null)
                        {
                            returnData.message     = "Successfull";
                            returnData.status_code = Convert.ToInt32(Status.Sucess);
                            returnData.data1       = new
                            {
                                patient.Patient_name,
                                patient.relation,
                                patient.Patient_contact
                            };
                        }
                        else
                        {
                            returnData.message     = "Mobile no is not found.";
                            returnData.status_code = Convert.ToInt32(Status.NotFound);
                        }
                    }
                }
                catch (Exception ex)
                {
                    ErrHandler.WriteError(ex.Message, ex);
                    returnData.data1       = ex;
                    returnData.message     = "Oops something went wrong! ";
                    returnData.status_code = Convert.ToInt32(Status.Failed);
                }
            }
            else
            {
                returnData.message     = "Please enter valid mobile no.";
                returnData.status_code = Convert.ToInt32(Status.Failed);
            }
            return(returnData);
        }
예제 #22
0
    protected void dynamicDDL_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            DropDownList DDL    = sender as DropDownList;
            string       vendor = (DDL.SelectedItem).ToString();

            DBservices dbs      = new DBservices();
            string     SNvendor = dbs.getVendorSN(vendor);
            Session["vendor"] = SNvendor;
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #23
0
    protected void  CancelBTN_Click(object sender, EventArgs e)
    {
        try
        {
            //gets order num from querystring
            NameValueCollection coll = Request.QueryString;
            int po_id = Convert.ToInt32(coll["Po_id"]);

            DBservices.DeleteOrder(po_id);
            Response.Redirect("OrderList.aspx", false);
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #24
0
        /// <summary>
        /// consulta convocatoria y actas :: ata el controlsource a gridview
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void B_Crear_Click(object sender, EventArgs e)
        {
            String nombreActa     = TB_NombreActa.Text;
            String idConvocatoria = DDL_Convocatoria.SelectedValue;

            String sql = "IF NOT EXISTS(SELECT CODCONVOCATORIA FROM ActaAcreditacionFinal WHERE CODCONVOCATORIA=" + idConvocatoria + ") INSERT INTO ActaAcreditacionFinal VALUES('" + nombreActa + "'," + idConvocatoria + ",GETDATE(),NULL)";

            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
            SqlCommand    cmd  = new SqlCommand(sql, conn);

            try
            {
                conn.Open();
                cmd.ExecuteReader();
            }
            catch (SqlException ex)
            {
                string url = Request.Url.ToString();

                string mensaje        = ex.Message.ToString();
                string data           = ex.Data.ToString();
                string stackTrace     = ex.StackTrace.ToString();
                string innerException = ex.InnerException == null ? "" : ex.InnerException.Message.ToString();

                // Log the error
                ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, usuario.Email, usuario.IdContacto.ToString());
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }

            divCrearActa.Visible = false;
            divCrearActa.Enabled = false;

            B_CrearApta.Visible = true;
            B_CrearApta.Enabled = true;
            GV_Actas.Visible    = true;
            GV_Actas.Enabled    = true;

            GV_Actas.DataBind();
            TB_NombreActa.Text = "";
        }
예제 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DBservices    dbs        = new DBservices();
            List <string> itemVendor = new List <string>();
            itemVendor = dbs.getVendorName();

            foreach (string name in itemVendor)
            {
                DDvandor.Items.Add(name);
            }
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #26
0
    protected void saveOrder(object sender, EventArgs e)
    {
        try
        {
            workerName = (string)(Session["Name"]);
            password   = (string)(Session["Password"]);
            status     = "open";
            OrderDate  = (string)(Session["OrderDate"]);

            workerID = dbs.getWorkerID(workerName, password);
            Branch   = dbs.getWorkerBranch(workerID);

            dbs.insertOrder(status, OrderDate, workerID, Branch);
            string poId = dbs.getPO_ID();

            int i = 0;
            foreach (Item x in listOfItem)
            {
                string  ObjID = "objBox" + i;
                TextBox Box   = (TextBox)tb.FindControl(ObjID);

                double num;
                bool   isNum = double.TryParse(Box.Text, out num);

                if (Box.Text != "" && Box.Text != Convert.ToString(0) && isNum == true)
                {
                    SN       = x.Serialnumber;
                    Quantity = Convert.ToInt32(Box.Text);
                    dbs.insertItemOrder(poId, SN, Quantity);
                }
                i++;
            }

            tb.Visible           = false;
            saveBTN.Visible      = false;
            massageOrder.Visible = true;
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("ארעה שגיאה");
        }
    }
예제 #27
0
    protected void AddMessage_Click(object sender, EventArgs e)
    {
        DBservices dbs = new DBservices();

        try
        {
            string text_message = TBnewMessage.Text;

            dbs.insertNewMessage(text_message);

            Response.Write("<script>alert('נוספה הודעה חדשה במערכת');</script>");
            Response.Redirect("message.aspx");
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("קיימת בעיה אנא נסה שנית מאוחר יותר");
        }
    }
예제 #28
0
        /// <summary>
        /// Handles the RowCommand event of the gvActasValidacion control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridViewCommandEventArgs"/> instance containing the event data.</param>
        protected void gvActasValidacion_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("eliminar"))
            {
                if (e.CommandArgument != null)
                {
                    try
                    {
                        int idActa = Convert.ToInt32(e.CommandArgument);

                        ActaFinalDeValidacion.EliminarActaValidacionYProyectos(idActa);

                        gvActasValidacion.DataBind();
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('Sucedio un error al eliminar el acta, intentelo de nuevo.');", true);

                        string url = Request.Url.ToString();

                        string mensaje        = ex.Message.ToString();
                        string data           = ex.Data.ToString();
                        string stackTrace     = ex.StackTrace.ToString();
                        string innerException = ex.InnerException == null ? "" : ex.InnerException.Message.ToString();

                        // Log the error
                        ErrHandler.WriteError(mensaje, url, data, stackTrace, innerException, usuario.Email, usuario.IdContacto.ToString());
                    }
                }
            }
            else if (e.CommandName.Equals("actualizar"))
            {
                if (e.CommandArgument != null)
                {
                    int idActa = Convert.ToInt32(e.CommandArgument.ToString().Split(';')[0]);

                    Session["idacta"]    = idActa;
                    Session["publicado"] = e.CommandArgument.ToString().Split(';')[1];

                    Response.Redirect("CrearActa.aspx");
                }
            }
        }
예제 #29
0
    protected void ButtonNewPatient_Click(object sender, EventArgs e)
    {
        try
        {
            DBservices dbs    = new DBservices();
            string     Name   = TBPatientName.Text;
            string     ID     = TBPatientId.Text;
            string     Num    = TBPatientNum.Text;
            string     Kupah  = (DDPatientKupah.SelectedItem).ToString();
            string     Zantar = (DDPatientZantar.SelectedItem).ToString();

            if (Zantar == "כן")
            {
                Zantar = "1";
            }
            else
            {
                Zantar = "0";
            }

            string needle      = (DDneedle.SelectedItem).ToString();
            string coil        = (DDcoil.SelectedItem).ToString();
            string infusionBag = (DDinfusionBag.SelectedItem).ToString();
            string solutions   = (DDsolutions.SelectedItem).ToString();


            string USERname   = (string)(Session["Name"]);
            string USERpass   = (string)(Session["Password"]);
            string USERid     = dbs.getWorkerID(USERname, USERpass);
            string USERbranch = dbs.getWorkerBranch(USERid);


            dbs.insertNewPatient(ID, Kupah, Num, Name, Zantar, USERbranch, needle, coil, infusionBag, solutions);
            Response.Write("<script>alert('המטופל נשמר בהצלחה');</script>");
            Response.Redirect("PatientList.aspx");
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("קיימת בעיה אנא נסה שנית מאוחר יותר");
        }
    }
예제 #30
0
    protected void DeletButton_Click(object sender, EventArgs e)
    {
        try
        {
            DBservices dbs = new DBservices();

            Label  lSN      = (Label)PHIteamNS.FindControl("lbSN");
            string SN       = lSN.Text;
            string numinbox = TBNumInBox.Text;
            string price    = TBPrice.Text;

            dbs.DeletItem(SN);
            Response.Redirect("itamList.aspx");
        }
        catch (Exception ex)
        {
            ErrHandler.WriteError(ex.Message);
            Response.Write("קיימת בעיה אנא נסה שנית מאוחר יותר");
        }
    }