Пример #1
0
        public DatabaseModule()
        {
            db = new RecordsDataSet();
            dbmgr = new TableAdapterManager();
            qadp = new QueriesTableAdapter();

            //Initialize Adapters for Reference Tables
            dbmgr.ClientTableAdapter = new ClientTableAdapter();
            dbmgr.ItemTableAdapter = new ItemTableAdapter();
            dbmgr.WarehouseTableAdapter = new WarehouseTableAdapter();

            //Initialize Adapters for Transaction Tables
            dbmgr.ItemInventoryTableAdapter = new ItemInventoryTableAdapter();
            dbmgr.ReturnsInventoryTableAdapter = new ReturnsInventoryTableAdapter();
            
            dbmgr.ItemReturnedTableAdapter = new ItemReturnedTableAdapter();

            dbmgr.InvoiceTableAdapter = new InvoiceTableAdapter();
            dbmgr.InvoiceItemTableAdapter = new InvoiceItemTableAdapter();

            dbmgr.InventoryMovementTableAdapter = new InventoryMovementTableAdapter();
            dbmgr.ItemServedTableAdapter = new ItemServedTableAdapter();

            dbmgr.ItemReturnedTableAdapter = new ItemReturnedTableAdapter();
            dbmgr.ReturnServedTableAdapter = new ReturnServedTableAdapter();
        }        
Пример #2
0
        private void btnAceptarSolicitud_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Seguro que desea aceptar esta solicitud?", "Aceptar solicitud", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                int idSolicitud = Convert.ToInt32(dgvSolicSinIniciar.SelectedRows[0].Cells[9].Value.ToString());

                FuncionesTableAdapter funcionesAdapter = new FuncionesTableAdapter();
                decimal validacion = funcionesAdapter.ValidarAsignacionTecnico(idSolicitud)[0].Valor;

                if (validacion == 1)
                {
                    QueriesTableAdapter queriesAdapter = new QueriesTableAdapter();


                    string codigo = dgvSolicSinIniciar.SelectedRows[0].Cells[0].Value.ToString();

                    queriesAdapter.AsignarTecnico(idSolicitud, usuario.IdEmpleado);

                    SolicitudesPresentablesTableAdapter solicitudesAdapter = new SolicitudesPresentablesTableAdapter();
                    dgvSolicSinIniciar.DataSource = solicitudesAdapter.SolicitudesSinIniciar(usuario.IdEmpleado);
                    dgvSolicEnProceso.DataSource  = solicitudesAdapter.SolicitudesEnTrabajo(usuario.IdEmpleado);

                    MessageBox.Show($"Solicitud {codigo} aceptada correctamente", "Aceptar solicitud", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Esta solicitud ya fue aceptada por el número máximo de técnicos posible, por lo que no puede trabajar en ella", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Пример #3
0
    protected void ibtnSave_Click(object sender, EventArgs e)
    {
        register_addpwd common = new register_addpwd();
        string          salt   = common.GenerateSalt().ToString();
        string          pwd    = common.EncodePassword(txtNewPwd.Text, 1, salt);

        QueriesTableAdapter amtup = new QueriesTableAdapter();
        int count = amtup.aspnet_Membership_ResetPassword("/", txtUserName.Text, pwd, 1, 1, salt, DateTime.Now, 1, txtAnswer.Text);

        if (count != 0)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('恭喜您!\\n\\n密码设置成功!');", true);
            txtUserName.Text   = "";
            txtNewPwd.Text     = "";
            txtConfirmPwd.Text = "";
            txtAnswer.Text     = "";
            //  Response.Write("<Script>alert('')</Script>");

            Response.Redirect("../Public/Index.aspx");
        }
        else
        {
            txtUserName.Text   = "";
            txtNewPwd.Text     = "";
            txtConfirmPwd.Text = "";
            txtAnswer.Text     = "";
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('对不起!\\n\\n用户名和答案不匹配,请重新输入!');", true);
        }
    }
Пример #4
0
        public void CambiaDataPrenotazione(string IdOrdineTestata, string DataPrenotazioneNew, string IdOrderEntry)
        {
            if (!string.IsNullOrEmpty(IdOrdineTestata) && !string.IsNullOrEmpty(DataPrenotazioneNew) && !string.IsNullOrEmpty(IdOrderEntry))
            {
                try
                {
                    DateTime dataPrenotazioneNew = DateTime.Parse(DataPrenotazioneNew);

                    // TODO: Verificare la necessità di convertire la data in UTC, è veramente necessario ? Cambia il giorno se si è vicino alla mezzanotte
                    //dataPrenotazioneNew = dataPrenotazioneNew.ToUniversalTime();

                    // Contatto il metodo del WCF OE per la ripianificazione dell'ordine.
                    // NB:   I dati vengo aggiornati su OE, il quale aggiorna i dati sul DataBase OE-Planner con qualche secondo di ritardo,
                    //       poiché c'è una sincronia tra i due DataBase (job di BitzTalk)
                    WcfOrderEntry.OrderEntryV1Client wcfOe = new WcfOrderEntry.OrderEntryV1Client("BasicHttpBinding_IOrderEntryV1"); //"BasicHttpBinding_IOrderEntryAdmin");
                    using (wcfOe)
                    {
                        OeUserToken oeUserToken = WcfOeToken.GetOeToken();
                        wcfOe.RipianificaOrdineIdRichiesta(oeUserToken.Token, IdOrderEntry, dataPrenotazioneNew);
                    }

                    // Scrivo nella tabella di OrderEntryPlanner la nuova data di pianificazione.
                    QueriesTableAdapter ta = new QueriesTableAdapter();
                    using (ta)
                    {
                        ta.OrdiniRiprogrammatiInserisce(new Guid(IdOrdineTestata), HttpContext.Current.User.Identity.Name, dataPrenotazioneNew);
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex, ex.Message);
                    throw;
                }
            }
        }
Пример #5
0
        public string CambiaDataPrenotazione(string IdOrdineTestata, string DataPrenotazioneNew, string IdOrderEntry)
        {
            if (!string.IsNullOrEmpty(IdOrdineTestata) && !string.IsNullOrEmpty(DataPrenotazioneNew) && !string.IsNullOrEmpty(IdOrderEntry))
            {
                DateTime dataPrenotazioneNew = DateTime.Parse(DataPrenotazioneNew);

                dataPrenotazioneNew = dataPrenotazioneNew.ToUniversalTime();

                // Scrivo nella tabella di OrderEntryPlanner la nuova data di pianificazione.
                QueriesTableAdapter ta = new QueriesTableAdapter();
                using (ta)
                {
                    ta.OrdiniRiprogrammatiInserisce(new Guid(IdOrdineTestata), HttpContext.Current.User.Identity.Name, dataPrenotazioneNew);
                }

                //Contatto il metodo del WCF OE per la ripianificazione dell'ordine.
                WcfOrderEntry.OrderEntryV1Client wcfOe = new WcfOrderEntry.OrderEntryV1Client("BasicHttpBinding_IOrderEntryV1"); //"BasicHttpBinding_IOrderEntryAdmin");
                using (wcfOe)
                {
                    OeUserToken oeUserToken = WcfOeToken.GetOeToken();
                    wcfOe.RipianificaOrdineIdRichiesta(oeUserToken.Token, IdOrderEntry, dataPrenotazioneNew);
                }
            }

            return("");
        }
Пример #6
0
        public CreateTradePoint()
        {
            dsRent    = new RentDataSet();
            daQueries = new QueriesTableAdapter();

            InitializeComponent();
        }
Пример #7
0
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            QueriesTableAdapter             queries = new QueriesTableAdapter();
            ingredients_recetteTableAdapter adapter = new ingredients_recetteTableAdapter();
            int id = int.Parse(Request.QueryString["code"]);

            foreach (GridViewRow row in GridView2.Rows)
            {
                //getNumIngQuery query in the DataSet return the number of ingredient count on name of ingredient
                int ingId = (int)queries.getNumIngQuery(row.Cells[1].Text);
                int qtn   = 0;
                try
                {
                    qtn = int.Parse(((TextBox)row.FindControl("qntTxt")).Text);
                }
                catch (FormatException ex)
                {
                    errorlbl.Visible = true;
                    return;
                }

                adapter.Insert(id, ingId, qtn);
            }

            Response.Redirect("~/CreerRecette.aspx");
        }
Пример #8
0
    protected void btnpass_Click(object sender, EventArgs e)
    {
        for (int i = 0; i <= gdvexamshop.Rows.Count - 1; i++)
        {
            CheckBox cbox      = (CheckBox)gdvexamshop.Rows[i].FindControl("cbxselshop");
            Label    lblshopid = (Label)gdvexamshop.Rows[i].FindControl("lblsign");
            if (cbox.Checked == true)
            {
                long shopid = new long();
                shopid = Convert.ToInt64(lblshopid.Text);
                QueriesTableAdapter qta = new QueriesTableAdapter();
                int count = qta.proc_updaterolesandshop("2", shopid);

                if (count == -1)
                {
                    Response.Write("<script language=javascript>alert('温馨提示:\\n\\n用户店铺审核通过!');</script>");
                    Response.Write("<script language=javascript>window.location.href='shopexamine.aspx'</script>");
                    //ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n" + GridView1.Rows[i].Cells[2].Text.Trim() + "您已经选择!');", true);
                }

                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n用户店铺由于一些原因审核失败!');", true);
                    //Response.Write("<script language=javascript>window.location.href='shopexamine.aspx'</script>");
                }
            }
        }
    }
Пример #9
0
 private string SinhMaTuDong()
 {
     try
     {
         string code = "";
         QueriesTableAdapter queries = new QueriesTableAdapter();
         string numbermax            = queries.GetMaLoaiCauThuMax().ToString();
         if (numbermax != "")
         {
             int temp = int.Parse(numbermax) + 1;
             code = "000" + temp;
             code = "LCT" + code.Substring(code.Length - 3);
         }
         else
         {
             code = "LCT001";
         }
         return(code);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     return(null);
 }
Пример #10
0
    protected void ibtnSave_Click(object sender, EventArgs e)
    {
        register_addpwd common = new register_addpwd();
        string salt = common.GenerateSalt().ToString();
        string pwd = common.EncodePassword(txtNewPwd.Text, 1, salt);

        QueriesTableAdapter amtup = new QueriesTableAdapter();
        int count = amtup.aspnet_Membership_ResetPassword("/", txtUserName.Text, pwd, 1, 1, salt, DateTime.Now, 1, txtAnswer.Text);
        if (count != 0)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('恭喜您!\\n\\n密码设置成功!');", true);
            txtUserName.Text = "";
            txtNewPwd.Text = "";
            txtConfirmPwd.Text = "";
            txtAnswer.Text = "";
            //  Response.Write("<Script>alert('')</Script>");

            Response.Redirect("../Public/Index.aspx");
        }
        else
        {
            txtUserName.Text = "";
            txtNewPwd.Text = "";
            txtConfirmPwd.Text = "";
            txtAnswer.Text = "";
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('对不起!\\n\\n用户名和答案不匹配,请重新输入!');", true);
        }
    }
Пример #11
0
        public static Session Create(int a_nofFiles, int a_nofFolders)
        {
            Session newSes = new Session {
                _NofFiles = a_nofFiles, _NofFolders = a_nofFolders
            };


            QueriesTableAdapter adpt = new QueriesTableAdapter();

            int?nSession_ID = null;

            int?nStartFile_ID   = null;
            int?nStartFolder_ID = null;

            adpt.CreateFileAddingSession(ref nSession_ID,
                                         ref nStartFile_ID, a_nofFiles,
                                         ref nStartFolder_ID, a_nofFolders);

            newSes._Session_ID = (int)nSession_ID;

            newSes._StartFile_ID   = (int)nStartFile_ID;
            newSes._StartFolder_ID = (int)nStartFolder_ID;


            return(newSes);
        }
Пример #12
0
        private void button_Login_Click(object sender, EventArgs e)
        {
            QueriesTableAdapter queriesTableAdapter = new QueriesTableAdapter();

            int ok = (int)queriesTableAdapter.GetAccountExistence(textBox_Email.Text, textBox_Password.Text);

            if (ok == 0)
            {
                MessageBox.Show(text: "Datele introduse sunt incorecte!",
                                caption: "Atentie!",
                                buttons: MessageBoxButtons.OK,
                                icon: MessageBoxIcon.Warning);
            }
            else
            {
                int Id_User = (int)queriesTableAdapter.GetIdUser_ByEmail(textBox_Email.Text);

                textBox_Email.Text    = "";
                textBox_Password.Text = "";

                if (checkBox_RememberMe.Checked)
                {
                    detaliiTableAdapter.UpdateQuery(checkBox_RememberMe.Checked, Id_User);
                }

                Form_Lobby form = new Form_Lobby(this, Id_User);

                Hide();

                form.Show();
            }
        }
Пример #13
0
        private void SyncToPSI_delete(marketSampleActEntity ent)
        {
            var      res2        = from x in dbcontext.Set <marketSalesShopEntity>() where x.SHOP_CODE.Equals(ent.SHOP_CODE) select x;
            DateTime date        = System.DateTime.Now;
            string   CREATE_DATE = date.ToString("yyyyMMddHHmmss");

            DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter();
            // if (!isChange)
            //{

            JS5_S12_SALES_SAMPLE_UPTableAdapter sampleAd = new JS5_S12_SALES_SAMPLE_UPTableAdapter();

            sampleAd.InsertQuery(ent.id, 1, ent.sales_No, CREATE_DATE, CREATE_DATE, "PSIadmin_APP@" + CREATE_DATE + "@APP", "PSIadmin_APP@" + CREATE_DATE + "@APP", 0, "FLNET"
                                 , ent.SAMPLE_UP_NO, res2.First().CUSTOMER_CODE, res2.First().CUSTOMER_NAME, ent.SHOP_CODE, ent.SHOP_NAME, ent.PRODUCT_TYPE_CODE, ent.PRODUCT_TYPE_NAME, ent.MACHINE_MODEL_NO, ent.SN_NO, ent.SAMPLE_DATE.Value, "无", ent.id, 1, "PSIadmin_APP", date, date, ent.UP_TYPE_CODE, ent.UP_TYPE_NAME,
                                 ent.SAMPLE_TYPE_CODE, ent.SAMPLE_TYPE_NAME, ent.SOURCE_SAMPLE_UP_NO, ent.PRODUCT_STATUS_CODE, ent.REMARK
                                 );

            QueriesTableAdapter tad = new QueriesTableAdapter();
            String outMessage       = "";

            tad.SP_SALES_SAMPLE_UPLOAD("FLNET", ent.id, out outMessage);
            if (!outMessage.Equals("OK"))
            {
                throw new Exception(outMessage);
            }
        }
Пример #14
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            int  valoracion         = 0;
            bool valoracionEscogida = false;

            foreach (RadioButton rbt in this.Controls.OfType <RadioButton>())
            {
                if (rbt.Checked == true)
                {
                    valoracion         = Convert.ToInt32(rbt.Name.Substring(3, 1));
                    valoracionEscogida = true;
                }
            }

            if (valoracionEscogida == true)
            {
                if (MessageBox.Show("¿Está seguro que desea ingresar este feedback?\n\nNo podrá cambiarlo despues.", "Insertar feedback", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    QueriesTableAdapter queriesAdapter = new QueriesTableAdapter();

                    queriesAdapter.InsertarFeedback(idSolicitud, usuario.IdEmpleado, valoracion, txtComentario.Text.Trim());

                    this.DialogResult = DialogResult.Yes;

                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Faltan por llenar la valoración", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #15
0
    protected void btnresetpass_Click(object sender, EventArgs e)
    {
        for (int i = 0; i <= gdvexamshop.Rows.Count - 1; i++)
        {
            CheckBox cbox = (CheckBox)gdvexamshop.Rows[i].FindControl("cbxselshop");
            Label lblshopid = (Label)gdvexamshop.Rows[i].FindControl("lblsign");
            if (cbox.Checked == true)
            {
                long shopid = new long();
                shopid = Convert.ToInt64(lblshopid.Text);
                QueriesTableAdapter qta = new QueriesTableAdapter();
                int count = qta.proc_updaterolesandshop("2", shopid);

                if (count==-1)
                {
                    Response.Write("<script language=javascript>alert('温馨提示:\\n\\n用户店铺状态已改为通过!');</script>");
                    Response.Write("<script language=javascript>window.location.href='shopexamine.aspx'</script>");
                    //ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n" + GridView1.Rows[i].Cells[2].Text.Trim() + "您已经选择!');", true);
                }

                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n用户店铺由于一些原因设置失败!');", true);
                }
            }
        }
    }
Пример #16
0
        List <Order> GetRestPartsOfOrders(DataRow[] searchedRows)
        {
            if (searchedRows == null || searchedRows.Length == null)
            {
                return(null);
            }
            List <Order> orders = new List <Order>();

            foreach (Tr_Tick_DBDataSet.MainRow orderRow in searchedRows)
            {
                Order order = new Order();
                order.ID         = orderRow.m_id;
                order.PersonName = orderRow.PersonRow.name;
                order.TicketName = orderRow.TicketRow.ticket_name;
                int tprice_id = orderRow.TicketRow.tprice_id;
                order.Date   = orderRow.month;
                order.Amount = orderRow.amount;
                order.Pledge = orderRow.pledge;

                QueriesTableAdapter adapter = new QueriesTableAdapter();
                int priceRes = (int)adapter.ScalarQuery(order.TicketName);
                order.Sum = priceRes * order.Amount;

                orders.Add(order);
            }
            return(orders);
        }
Пример #17
0
        public static string CompanyName()
        {
            QueriesTableAdapter tAdapter = new QueriesTableAdapter();
            string companyName           = tAdapter.SQCompanyName().ToString();

            return(companyName);
        }
Пример #18
0
    public int POS_update_bill(int billid, Decimal total)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Update_Bill(billid, total);

        return(a);
    }
Пример #19
0
    public int POS_Delete_Product(int productid)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Delete_Product(productid);

        return(a);
    }
Пример #20
0
    public int POS_delete_ProductOptionRelation(int productid, int optionid)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Delete_productOptionRel(productid, optionid);

        return(a);
    }
Пример #21
0
    public int POS_update_ProductOptionRelation(int productid, int Oldoptionid, int Newoptionid)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Update_productOptionRel(productid, Oldoptionid, Newoptionid);

        return(a);
    }
Пример #22
0
    public int POS_update_ProductOption(int productid, string optionName, Decimal optionPrice, string optionDetails)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Update_ProductOption(productid, optionName, optionPrice, optionDetails);

        return(a);
    }
Пример #23
0
    public int POS_add_ProductOption(string optionName, Decimal optionPrice, string optionDetails)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Add_ProductOption(optionName, optionPrice, optionDetails);

        return(a);
    }
Пример #24
0
    public int POS_delete_catagory(int catagoryid)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Delete_Catagory(catagoryid);

        return(a);
    }
Пример #25
0
    public int POS_add_catagory(string catagoryName, string catagoryDetail)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Add_Catagory(catagoryName, catagoryDetail);

        return(a);
    }
Пример #26
0
    public int POS_Update_Product(int productid, string productName, int catagoryid, Decimal price, int statusid, int quantity, string productDesc, decimal buyingPrice)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Update_Product(productid, productName, catagoryid, price, statusid, quantity, productDesc, buyingPrice);

        return(a);
    }
Пример #27
0
    public string POS_Order_Options(ref int?got, string result)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Ordering_ProductOptions(ref got, result);

        return(got + "");
    }
Пример #28
0
    public int POS_update_catagory(int catagoryid, string catagoryName, string catagoryDetail)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Update_Catagory(catagoryid, catagoryName, catagoryDetail);

        return(a);
    }
Пример #29
0
    public int POS_delete_bill(int billid)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_delete_Bill(billid);

        return(a);
    }
Пример #30
0
    public int POS_update_Employee(int id, string FName, string LName, string Status_id, string phone_no, string Rank_id, string birthdate, string Email, string Password, string PIN, string Joindate, string Jobdesc, string Absents, string Salary, string Net_amount)
    {
        POSDataSet          pdb = new POSDataSet();
        QueriesTableAdapter pta = new QueriesTableAdapter();
        var a = pta.POS_Update_Employee(id, FName, LName, int.Parse(Status_id), phone_no, int.Parse(Rank_id), Convert.ToDateTime(birthdate), Email, Password, PIN, Convert.ToDateTime(Joindate), Jobdesc, byte.Parse(Absents), decimal.Parse(Salary), decimal.Parse(Net_amount));

        return(a);
    }
Пример #31
0
    protected void btnPublic_Click1(object sender, EventArgs e)
    {
        string phonename = txtphonename.Text.ToString();

        string uname = Session["name"].ToString();
        select_id_viewTableAdapter selid = new select_id_viewTableAdapter();
        DataTable dtid     = selid.selectidbyuname(uname);
        string    owner    = dtid.Rows[0][0].ToString();
        Guid      sellerid = new Guid();

        sellerid = Guid.Parse(owner);
        string shopname = dtid.Rows[0][1].ToString();
        string brand    = ddlbrand.SelectedItem.Text;
        string version  = ddlversion.SelectedItem.Text;
        string color    = ddlcolor.SelectedItem.Text;

        string priceint = ddlpriceinterval.SelectedItem.Text;

        string[] sArray = priceint.Split('-');
        string   str1   = sArray[0].ToString().Trim();
        string   str2   = sArray[1].ToString().Trim();
        int      low    = Convert.ToInt32(str1.ToString());
        int      high   = Convert.ToInt32(str2.ToString());


        string   os           = ddlos.SelectedItem.Text;
        string   cpu          = ddlcpu.SelectedItem.Text;
        string   type         = ddltype.SelectedItem.Text;
        string   piexl        = ddlpixel.SelectedItem.Text;
        string   screen       = ddlscreensize.SelectedItem.Text;
        int      quantity     = Convert.ToInt32(txtquantity.Text);
        int      price        = Convert.ToInt32(txtprice.Text);
        string   introduction = txtintroduce.Text;
        string   image        = img;
        DateTime starttime    = DateTime.Today;
        DateTime selltime     = DateTime.Today;
        string   state        = "1";

        if (price > high || price < low)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n您输入的商品价格与选择的价格区间不符!\\n请重新选择区间');", true);
            return;
        }

        QueriesTableAdapter insertinfo = new QueriesTableAdapter();
        int result = insertinfo.proc_insertphoneinfo(phonename, sellerid, shopname, brand, version, color, low, high, os, cpu, type, piexl, screen, quantity, price, introduction, image, starttime, selltime, state);

        if (result == -1)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品插入成功!');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品信息由于一些原因审核失败!');", true);
        }
    }
        public void DeleteAllElementsTest()
        {
            QueriesTableAdapter target = new QueriesTableAdapter(); // TODO: Initialize to an appropriate value
            int expected = 0;                                       // TODO: Initialize to an appropriate value
            int actual;

            actual = target.DeleteAllElements();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Пример #33
0
        public void loadDBFToDb_House(FileInfo dbfFile, SqlConnection connection)
        {
            NDbfReader.Table    dbfTable  = NDbfReader.Table.Open(dbfFile.Open(FileMode.Open));
            NDbfReader.Reader   dbfReader = dbfTable.OpenReader(System.Text.Encoding.GetEncoding(866));
            QueriesTableAdapter qta       = new QueriesTableAdapter();
            int       c  = 1;
            guidparse gp = (string x) => { if (x == null)
                                           {
                                               return(null);
                                           }
                                           else
                                           {
                                               return(Guid.Parse(x));
                                           } };

            while (dbfReader.Read())
            {
                Int32 ESTSTATUS;
                Int32.TryParse(dbfReader.GetValue("ESTSTATUS").ToString(), out ESTSTATUS);
                if (!(bool)qta.CanInsert_tmpHouse_Query(Guid.Parse(dbfReader.GetValue("HOUSEID").ToString())) &&
                    (bool)qta.CanInsert_tmpHouseAO_Query(Guid.Parse(dbfReader.GetValue("AOGUID").ToString()))
                    )
                {
                    qta.Insert_tmpHouse_Query(
                        dbfReader.GetString("POSTALCODE"),
                        dbfReader.GetString("IFNSFL"),
                        dbfReader.GetString("TERRIFNSFL"),
                        dbfReader.GetString("IFNSUL"),
                        dbfReader.GetString("TERRIFNSUL"),
                        dbfReader.GetString("OKATO"),
                        dbfReader.GetString("OKTMO"),
                        dbfReader.GetDateTime("UPDATEDATE"),
                        dbfReader.GetString("HOUSENUM"),
                        Int32.Parse(dbfReader.GetValue("ESTSTATUS").ToString()),
                        dbfReader.GetString("BUILDNUM"),
                        dbfReader.GetString("STRUCNUM"),
                        Int32.Parse(dbfReader.GetValue("STRSTATUS").ToString()),
                        Guid.Parse(dbfReader.GetValue("HOUSEID").ToString()),
                        Guid.Parse(dbfReader.GetValue("HOUSEGUID").ToString()),
                        Guid.Parse(dbfReader.GetValue("AOGUID").ToString()),
                        dbfReader.GetDateTime("STARTDATE").Value,
                        dbfReader.GetDateTime("ENDDATE").Value,
                        Int32.Parse(dbfReader.GetValue("STATSTATUS").ToString()),
                        gp(dbfReader.GetString("NORMDOC")),
                        Int32.Parse(dbfReader.GetValue("COUNTER").ToString()),
                        dbfReader.GetString("CADNUM"),
                        Int32.Parse(dbfReader.GetValue("DIVTYPE").ToString()));
                }
                c++;
                LogInfo(c.ToString() + ". " + Guid.Parse(dbfReader.GetValue("HOUSEID").ToString()));
            }

            dbfTable.Dispose();
            dbfFile.Delete();
        }
Пример #34
0
 private static void CallStoreProc() {
     try {
         QueriesTableAdapter q = new QueriesTableAdapter();
         int carID = 1000;
         string carName = "";
         q.GetPetName(carID, ref carName);
         Console.WriteLine("Car {0} has name: {1}", carID, carName);
     } catch (Exception ex) {
         Console.WriteLine(ex.Message);
     }
 }
Пример #35
0
 public static void CallStoredProc()
 {
     try
     {
         QueriesTableAdapter q = new QueriesTableAdapter();
         Console.Write("Enter ID of car to look up: ");
         string carID = Console.ReadLine();
         string carName = "";
         q.GetPetName(int.Parse(carID), ref carName);
         Console.WriteLine("CarID {0} has the name of {1}", carID, carName);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Пример #36
0
    protected void btnPublic_Click1(object sender, EventArgs e)
    {
        string phonename = txtphonename.Text.ToString();

           string uname = Session["name"].ToString();
           select_id_viewTableAdapter selid = new select_id_viewTableAdapter();
           DataTable dtid = selid.selectidbyuname(uname);
           string owner = dtid.Rows[0][0].ToString();
           Guid sellerid = new Guid();
           sellerid = Guid.Parse(owner);
           string shopname = dtid.Rows[0][1].ToString();
           string brand = ddlbrand.SelectedItem.Text;
           string version = ddlversion.SelectedItem.Text;
           string color = ddlcolor.SelectedItem.Text;

           string priceint = ddlpriceinterval.SelectedItem.Text;
           string[] sArray = priceint.Split('-');
           string str1 = sArray[0].ToString().Trim();
           string str2 = sArray[1].ToString().Trim();
           int low = Convert.ToInt32(str1.ToString());
           int high = Convert.ToInt32(str2.ToString());

           string os = ddlos.SelectedItem.Text;
           string cpu = ddlcpu.SelectedItem.Text;
           string type = ddltype.SelectedItem.Text;
           string piexl = ddlpixel.SelectedItem.Text;
           string screen = ddlscreensize.SelectedItem.Text;
           int quantity = Convert.ToInt32(txtquantity.Text);
           int price = Convert.ToInt32(txtprice.Text);
           string introduction = txtintroduce.Text;
           string image = img;
           DateTime starttime =  DateTime.Today;
           DateTime selltime = DateTime.Today;
           string state = "1";

           if (price > high || price < low)
           {
           ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n您输入的商品价格与选择的价格区间不符!\\n请重新选择区间');", true);
           return;
           }

           QueriesTableAdapter insertinfo = new QueriesTableAdapter();
           int result = insertinfo.proc_insertphoneinfo(phonename,sellerid,shopname,brand,version,color,low,high,os,cpu,type,piexl,screen,quantity,price,introduction,image,starttime,selltime,state);

           if (result==-1)
           {
           ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品插入成功!');", true);

           }
           else
           {
           ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品信息由于一些原因审核失败!');", true);

           }
    }
        private string SinhMaTuDong()
        {
            try
            {
                string code = "";
                QueriesTableAdapter queries = new QueriesTableAdapter();
                string numbermax = queries.GetMaLoaiCauThuMax().ToString();
                if (numbermax != "")
                {

                    int temp = int.Parse(numbermax) + 1;
                    code = "000" + temp;
                    code = "LCT" + code.Substring(code.Length - 3);
                }
                else
                {
                    code = "LCT001";
                }
                return code;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return null;
        }
Пример #38
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            QueriesTableAdapter q = new QueriesTableAdapter();
            int count = (int)q.ProtocolsCount();
            toolStripStatusLabel2.Text = count.ToString();

            if (count != newVipAvtoSet.Protocols.Count)
            {
                int saveRow = 0;
                if (dataGridView1.Rows.Count > 0)
                    saveRow = dataGridView1.FirstDisplayedCell.RowIndex;

                if (dataGridView1.SelectedRows.Count != 0)
                    _selectedRow = (int)dataGridView1.SelectedRows[0].Cells[0].Value;

                newVipAvtoSet.Mesures.Clear();
                var adapter = new MesuresTableAdapter();
                protocolsTableAdapter.Fill(newVipAvtoSet.Protocols);
                adapter.Fill(newVipAvtoSet.Mesures);

                int[] t =
            (from DataGridViewRow row in dataGridView1.Rows
             where (int)row.Cells[0].Value == _selectedRow
             select row.Index
            ).ToArray();
                if (t.Length != 0)
                    dataGridView1.Rows[t[0]].Selected = true;

                if (saveRow != 0 && saveRow < dataGridView1.Rows.Count)
                    dataGridView1.FirstDisplayedScrollingRowIndex = saveRow;

            }
        }
        List<Order> GetRestPartsOfOrders(DataRow[] searchedRows)
        {
            if (searchedRows == null || searchedRows.Length == null)
                return null;
            List<Order> orders = new List<Order>();
            foreach (Tr_Tick_DBDataSet.MainRow orderRow in searchedRows)
            {
                Order order = new Order();
                order.ID = orderRow.m_id;
                order.PersonName = orderRow.PersonRow.name;
                order.TicketName = orderRow.TicketRow.ticket_name;
                int tprice_id = orderRow.TicketRow.tprice_id;
                order.Date = orderRow.month;
                order.Amount = orderRow.amount;
                order.Pledge = orderRow.pledge;

                QueriesTableAdapter adapter = new QueriesTableAdapter();
                int priceRes = (int) adapter.ScalarQuery(order.TicketName);
                order.Sum = priceRes * order.Amount;

                orders.Add(order);
            }
            return orders;
        }
Пример #40
0
        private string SinhMaTuDong()
        {
            try
            {
                string code = "";
                QueriesTableAdapter queries = new QueriesTableAdapter();
                string numbermax = queries.GetMaMuaMax().ToString();
                if (numbermax != "")
                {

                    int temp = int.Parse(numbermax) + 1;
                    code = "000" + temp;
                    code = "MG" + code.Substring(code.Length - 4);
                }
                else
                {
                    code = "MG0001";
                }
                return code;

            }
            catch (Exception)
            {
            }
            return null;
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (lstInstructors.SelectedValue != "")
        {
            //txtLoad.Text = lstInstructors.SelectedValue;
            //calApp.SelectedDate = GetStartDate();
            //calApp.Visible = true;

            Session["DocID"] = lstInstructors.SelectedValue.ToString();
            PatientDoctorTableAdapter adap_patDoc = new PatientDoctorTableAdapter();
            DataSet1.PatientDoctorDataTable dt = new DataSet1.PatientDoctorDataTable();
            dt = adap_patDoc.GetData(Convert.ToInt32(Session["PatientID"]));

            if (dt.Rows.Count == 0 || !dt.Rows[0][0].ToString().Equals(Session["DocID"]))
            {
                QueriesTableAdapter adap_ins = new QueriesTableAdapter();
                adap_ins.PatDocInsertQuery(Convert.ToInt32(Session["PatientID"]), Convert.ToInt32(Session["DocID"]));

                lblMessage.ForeColor = Color.White;
                lblMessage.BackColor = Color.White;
                lblMessage.Text = "Doctor Added Successfully!";
                dt = adap_patDoc.GetData(Convert.ToInt32(Session["PatientID"]));
                GridView1.Visible = true;
                GridView1.DataBind();
                lblMessage.Visible = false;
                lstInstructors.Visible = false;
                LBLdOC.Visible = false;
                txtSearchValue.Text = string.Empty;
                Button1.Visible = false;
            }
            else
            {
                lblMessage.ForeColor = Color.Black;
                lblMessage.BackColor = Color.Red;
                lblMessage.Text = "You have already added this doctor.";
            }
        }

        else
        {
            lblMessage.ForeColor = Color.Black;
            lblMessage.BackColor = Color.Red;
            lblMessage.Text = "Please select a Doctor.";
        }
    }
Пример #42
0
 protected void cmdSend_Click(object sender, EventArgs e)
 {
     SendMail();
     QueriesTableAdapter adap_mess = new QueriesTableAdapter();
     adap_mess.InsertQuery(Session["PatientID"].ToString(), Session["DocID"].ToString(), txtMessage.Text, txtSubject.Text, 1, 0);
 }
Пример #43
0
        private void Form1_Load(object sender, EventArgs e)
        {
            BuildOrgStructureTree();

            //ADMethodsAccountManagement ADMethods = new ADMethodsAccountManagement();

            //UserPrincipal myUser = ADMethods.GetUser(@"druzhinin");

            //MessageBox.Show(myUser.GivenName + " " + myUser.EmailAddress);

            m_TableAdapterManager = new TableAdapterManager();
            m_TableAdapterManager.StaffTableAdapter = new StaffTableAdapter();
            m_TableAdapterManager.stfOrgStructureTableAdapter = new stfOrgStructureTableAdapter();
            m_TableAdapterManager.NewUserTableAdapter = new NewUserTableAdapter();

            m_CommonQuery = new QueriesTableAdapter();

            m_StaffTbl = new dsITO.StaffDataTable();
            m_NewUser = new dsITO.NewUserDataTable();
            m_TableAdapterManager.NewUserTableAdapter.Fill(m_NewUser);

            m_OrgStructure = new dsITO.stfOrgStructureDataTable();

            m_TableAdapterManager.StaffTableAdapter.Fill(m_StaffTbl);

            m_ITOSQLCommand = new ITODAL();

            m_ITOSQLCommand.OpenConnection("Data Source=10.15.140.2;Initial Catalog=ITO;Persist Security Info=True;User ID=evgeny;Password=ywfaggzu");

            //Заполняем ComboBox данными из базы

            //Должности
            DataTable dt = m_ITOSQLCommand.ExecuteSQLCommand("Select PositionID, Name from stfPositions");

            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                ListElement le = new ListElement(dt.Rows[curRow][0].ToString(), dt.Rows[curRow][1].ToString());
                cbPosition.Items.Add(le);

            }

            //Подразделения
            dt = m_ITOSQLCommand.ExecuteSQLCommand("Select DepartmentID, ShortName, Name from stfOrgStructure");

            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                ListElement le = new ListElement(dt.Rows[curRow][0].ToString(), dt.Rows[curRow][1].ToString() + " " + dt.Rows[curRow][2].ToString());
                cbDepartment.Items.Add(le);

            }

            //Здания
            dt = m_ITOSQLCommand.ExecuteSQLCommand("Select BuildingID, Name from stfBuildings");

            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                ListElement le = new ListElement(dt.Rows[curRow][0].ToString(), dt.Rows[curRow][1].ToString());
                cbWorkPlace.Items.Add(le);

            }

            dt = m_ITOSQLCommand.ExecuteSQLCommand("Select UserID,LastName,Name,SecondName from Staff");

            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                ListElement le = new ListElement(dt.Rows[curRow][0].ToString(), dt.Rows[curRow][1].ToString()+" "+dt.Rows[curRow][2].ToString()+" "+dt.Rows[curRow][3].ToString());
                cmbUser.Items.Add(le);

            }

            dt = m_ITOSQLCommand.ExecuteSQLCommand("Select distinct Place from Invent");

            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                cbPlace.Items.Add(dt.Rows[curRow][0].ToString());
            }

            dt = m_ITOSQLCommand.ExecuteSQLCommand("Select distinct Room from Invent");
            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                cbRoom.Items.Add(dt.Rows[curRow][0].ToString());
            }
        }