Esempio n. 1
0
    public dynamic insert <clase>(clase obj, bool retornar) where clase : class, new()
    {
        IORM   orm   = new insert();
        string query = orm.construir <clase>(obj, retornar);

        return(this.queryForMap <clase>(query));
    }
Esempio n. 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            // Note: Please enable SOAP/REST services in your SNow dev instance table(s), Also,
            // Go to system web services --> properties -> enable the 3rd option from the bottom.(This property sets the elementFormDefault attribute of the embedded XML schema to the value of unqualified)
            ServiceNowSoapClient client = new ServiceNowSoapClient();

            client.ClientCredentials.UserName.UserName = "******"; // makhan8 have SOAP role in SNow.
            client.ClientCredentials.UserName.Password = "******";

            insert         newRecord      = new insert();
            insertResponse insertResponse = new insertResponse();

            newRecord.first_name   = "Jackson";
            newRecord.last_name    = "Chris";
            newRecord.phone_number = "911-911-9999";
            //newRecord.number = "CUS3048232";
            try
            {
                insertResponse = client.insert(newRecord);
                TextBox1.Text  = insertResponse.sys_id;
            }
            catch (Exception ex)
            {
                TextBox1.Text = ex.Message;
            }
            finally { client.Close(); }
        }
Esempio n. 3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         selectdata sd = new selectdata();
         string     s  = sd.returnscalar("select count(ad_id) from tbl_admin  where ad_email='" + txtemail.Text + "'");
         if (s == "0")
         {
             admin a = new admin();
             a.email    = txtemail.Text;
             a.password = txtpassword.Text;
             a.phone    = txtphone.Text;
             insert i = new insert();
             Session["admin_id"] = i.signup_admin(a);
             if (Session["admin_id"] == "-1")
             {
                 Label1.Text = "Some Error Occurred Please Try Again.";
             }
             else
             {
                 Response.Redirect("~/View/Admin/adminpannel.aspx");
             }
         }
         else if (s == "1")
         {
             Label1.Text = "Email ID Already Exists.";
         }
         else
         {
             Label1.Text = "Some Error Occurred Please Try Again.";
         }
     }
 }
Esempio n. 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                donors d = new donors();
                d.d_email    = txtemail.Text;
                d.d_password = txtcpassword.Text;
                d.d_cinc     = txtcnic.Text;
                d.d_name     = txtname.Text;
                d.d_age      = Convert.ToInt32(DropDownList3.SelectedValue);

                d.d_contact = TXTCONTCT.Text;
                d.d_hb      = (float)Convert.ToDouble(txthb.Text);
                d.d_sex     = DropDownList5.Text;
                d.d_bgroup  = DropDownList1.SelectedValue.ToString();
                d.d_status  = Convert.ToString(0);
                insert i   = new insert();
                string msg = i.insert_donor(d);
                if (msg == "-1")
                {
                    Label1.Text = "some error";
                }
                else
                {
                    HttpCookie cookie = new HttpCookie("DONOR");
                    cookie["email"] = Server.UrlEncode(txtemail.Text);
                    cookie["pwd"]   = Server.UrlEncode(txtcpassword.Text);
                    cookie.Expires  = DateTime.Now.AddDays(30);
                    Response.Cookies.Add(cookie);
                    Session["u_id"] = msg;
                    Response.Redirect("~/views/profile.aspx");
                }
            }
        }
Esempio n. 5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         donors d = new donors();
         d.d_email    = txtemail.Text;
         d.d_password = txtpassword.Text;
         d.d_cnic     = txtcnic.Text;
         d.d_name     = txtname.Text;
         d.d_age      = Convert.ToInt32(DropDownList3.SelectedValue);
         d.d_hosp_id  = Convert.ToInt32(DropDownList2.SelectedValue);
         d.d_contact  = txtcontact.Text;
         d.d_bgroup   = DropDownList2.SelectedValue.ToString();
         insert i   = new insert();
         string msg = i.insert_donor(d);
         if (msg == "-1")
         {
         }
         else
         {
             Session["u_id"] = msg;
             Response.Redirect("~/views/profile.aspx");
         }
     }
 }
Esempio n. 6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            float   c = Convert.ToInt64(TextBox3.Text);
            product p = new product();

            p.pro_name  = TextBox1.Text;
            p.pro_date  = TextBox2.Text;
            p.pro_price = c;
            //p.pro_img = img_upload(FileUpload1, Session["admin_id"].ToString());
            p.pro_img        = img_upload(FileUpload1);
            p.pro_catid_fk   = Convert.ToInt32(DropDownList1.SelectedValue.ToString());
            p.pro_adminid_fk = Convert.ToInt32(Session["admin_id"].ToString());
            insert i = new insert();

            ViewState["ad_id"] = i.insert_tblproduct(p);
            if (ViewState["ad_id"].ToString() == "-1")
            {
                Label2.Text = "TRY AGAIN ....";
            }
            else
            {
                Label2.Text         = "The add was successfully posted!";
                LinkButton3.Visible = true;
                TextBox1.Text       = " ";
                TextBox3.Text       = " ";
                //Response.Redirect("~/View/Admin/adminpannel.aspx");
            }
        }
Esempio n. 7
0
    public dynamic insert <clase>(clase obj)
    {
        IORM   orm   = new insert();
        string query = orm.construir <clase>(obj, false);

        return(globales.consulta(query, true));
    }
        protected void Csignin_Click(object sender, EventArgs e)

        {
            if (Page.IsValid)
            {
                selectdata sd = new selectdata();
                string     s  = sd.returnscalar("select count(cu_id) from tbl_custom  where cu_email='" + email.Text + "'");
                if (s == "0")
                {
                    customer c = new customer();
                    c.email    = email.Text;
                    c.password = password.Text;
                    c.phone    = phone.Text;

                    insert i = new insert();
                    Session["customer_id"] = i.signup_customer(c);
                    if (Session["customer_id"] == null)
                    {
                        Label1.Text = "some exception ";
                    }
                    else
                    {
                        Session["customer_mail"] = sd.returnscalar("select cu_email from tbl_custom where cu_id=" + Session["customer_id"]);


                        Response.Redirect("~/Home_Main.aspx");
                    }
                }
                else
                {
                    Label1.Text = "Email already exist";
                }
            }
        }
Esempio n. 9
0
        public ActionResult Search(string value)
        {
            insert list = new insert();

            list.list      = GetCSVAsync(value);
            list.count     = list.list.Count();
            list.searchVal = value;
            Dispose();
            return(View(list));
        }
Esempio n. 10
0
    public dynamic insertAll <clase>(List <clase> listaObj)
    {
        string query = string.Empty;

        foreach (clase item in listaObj)
        {
            IORM orm = new insert();
            query += orm.construir <clase>(item, false);
        }


        return(globales.consulta(query, true));
    }
Esempio n. 11
0
        /// <summary>
        /// 重新加载数据
        /// </summary>
        protected virtual void reset()
        {
            insert insert = new insert {
                Groups = dictionary <randomKey <keyType> > .Create <keyValue <keyType, list <valueType> > >(), GetKey = getKey
            };

            foreach (valueType value in cache.Values)
            {
                insert.OnInserted(value);
            }
            this.groups = insert.Groups;
            ++keyVersion;
        }
Esempio n. 12
0
        /// <summary>
        /// 重新加载数据
        /// </summary>
        protected virtual void reset()
        {
            insert insert = new insert {
                groups = dictionary <randomKey <keyType> > .Create <group>(), getKey = getKey
            };

            foreach (valueType value in cache.Values)
            {
                insert.onInserted(value);
            }
            groups = insert.groups;
            ++keyVersion;
        }
 public void AttachFile(string UID, string path)
 {
     ServiceNowSoapClient ServiceNowReference = new ServiceNowSoapClient();
     var file = File.ReadAllBytes(path);
     var insert = new insert
     {
         agent = "AttachmentCreator",
         topic = "AttachmentCreator",
         name = path.Substring(path.LastIndexOf('\\') + 1) + ":" + GetContentType(path.Substring(path.LastIndexOf('.'))),
         source = "incident:" + UID,
         payload = Convert.ToBase64String(file)
     };
     var res = ServiceNowReference.insert(insert);
 }
Esempio n. 14
0
    public dynamic insertAll <clase>(List <clase> listaObj, bool retornar) where clase : class, new ()
    {
        string query = string.Empty;

        foreach (clase item in listaObj)
        {
            IORM orm = new insert();
            query += orm.construir <clase>(item, false);
        }

        if (retornar)
        {
            if (!string.IsNullOrWhiteSpace(query))
            {
                string[] separarQuerys = query.Split(';');
                if (separarQuerys.Length > 0)
                {
                    string primerSentencia  = separarQuerys[0].Substring(0, separarQuerys[0].IndexOf("values"));
                    string segundaSentencia = string.Empty;
                    foreach (string item in separarQuerys)
                    {
                        if (!string.IsNullOrWhiteSpace(item))
                        {
                            segundaSentencia += item.Substring(item.IndexOf("values")) + ",";
                        }
                    }

                    segundaSentencia = segundaSentencia.Substring(0, segundaSentencia.Length - 1);
                    primerSentencia  = primerSentencia + " values " + segundaSentencia.Replace("values", "") + " returning *; ";
                    query            = primerSentencia;
                }
            }
        }

        List <clase> lista = new List <clase>();
        List <Dictionary <string, object> > resu = globales.consulta(query);

        foreach (Dictionary <string, object> item in resu)
        {
            clase c = getObject <clase>(item);
            lista.Add(c);
        }

        return(lista);
    }
Esempio n. 15
0
        /// <summary>
        /// 重新加载数据
        /// </summary>
        private void reset()
        {
            insert insert = new insert {
                groups = new Dictionary <keyType, keyValue <keyType, list <valueType> > >(), getKey = getKey
            };

            Monitor.Enter(cache.SqlTool.Lock);
            try
            {
                foreach (valueType value in cache.Values)
                {
                    insert.onInserted(value);
                }
                this.groups = insert.groups;
                ++keyVersion;
            }
            finally { Monitor.Exit(cache.SqlTool.Lock); }
        }
Esempio n. 16
0
        /// <summary>
        /// This function creates a new incident in ServiceNOW
        /// </summary>
        /// <param name="Credential">A credential object that gets passed to the soap client for authentication</param>
        /// <param name="Incident">An insert object that contains the data to be inserted into ServiceNOW</param>
        /// <returns>An insertResponse object containing data returned from ServiceNOW</returns>
        public static insertResponse NewIncident(NetworkCredential Credential, insert Incident, string ServiceNowUrl)
        {
            try
            {
                string userName             = Credential.UserName;
                string userPass             = Credential.Password;
                ServiceNowSoapClient client = soapClient(userName, userPass, ServiceNowUrl);

                insertResponse response = new insertResponse();

                response = client.insert(Incident);
                return(response);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 17
0
        /// <summary>
        /// This function creates a new incident in ServiceNOW
        /// </summary>
        /// <param name="Credential">A credential object that gets passed to the soap client for authentication</param>
        /// <param name="Incident">An insert object that contains the data to be inserted into ServiceNOW</param>
        /// <returns>An insertResponse object containing data returned from ServiceNOW</returns>
        public static insertResponse NewIncident(NetworkCredential Credential, insert Incident, string ServiceNowUrl)
        {
            try
            {
                string userName = Credential.UserName;
                string userPass = Credential.Password;
                ServiceNowSoapClient client = soapClient(userName, userPass, ServiceNowUrl);

                insertResponse response = new insertResponse();

                response = client.insert(Incident);
                return response;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string flag = file_upload(FileUpload1, Session["u_id"].ToString());

            if (flag.Equals("-1"))
            {
                Response.Write("<script>alert('image could not be upload... '); </script> ");
            }
            else
            {
                donor_img img = new donor_img();
                img.img_path = flag;

                img.img_fk_id = Convert.ToInt32(Session["u_id"].ToString());
                insert i = new insert();
                i.insert_donor_img(img);
                Response.Redirect("~/views/profile.aspx");
            }
        }
        protected void Checkout_Click(object sender, EventArgs e)
        {
            Order o = new Order();

            o.order_price = Convert.ToDecimal(Session["F_total"]);
            o.placed_date = DateTime.Now.ToString();
            if (Session["customer_mail"] != null)
            {
                o.customer_id = Convert.ToInt32(Session["customer_id"]);

                insert i = new insert();
                Session["OrderNumber"] = i.insert_order(o);
                Response.Redirect("~/Checkout/Order.aspx");
            }
            else
            {
                Response.Redirect("~/CustomerAccount/CLogin.aspx");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Session["u_id"] == null)
            {
                Response.Write("<script>alert('you must login 1st'); </script>");
                Response.Redirect("~/views/login.aspx");
            }


            comment c = new comment();

            c.cidfkon    = Convert.ToInt32(HiddenField1.Value);
            c.cidfkfrom  = Convert.ToInt32(Session["u_id"].ToString());
            c.commenttxt = TextBox1.Text;
            insert i = new insert();

            i.insert_comment(c);
            Server.Transfer("~/views/viewprofile.aspx?view=" + HiddenField1.Value);
        }
Esempio n. 21
0
        /// <summary>
        /// 重新加载数据
        /// </summary>
        private void reset()
        {
            insert insert = new insert {
                groups = new Dictionary <groupKeyType, Dictionary <keyType, valueType> >(), getGroupKey = getGroupKey, getKey = getKey
            };

            Monitor.Enter(cache.SqlTool.Lock);
            try
            {
                foreach (valueType value in cache.Values)
                {
                    if (isValue(value))
                    {
                        insert.onInserted(value);
                    }
                }
                this.groups = insert.groups;
            }
            finally { Monitor.Exit(cache.SqlTool.Lock); }
        }
Esempio n. 22
0
        /// <summary>
        /// This function inserts a server into the ServiceNow CI Database
        /// </summary>
        /// <param name="Credential">A NetworkCredential object that gets passed to the soap client for authentication</param>
        /// <param name="Server">An insert object that contains the data to be inserted into ServiceNOW</param>
        /// <returns>An insertResponse object containing data returned from ServiceNOW</returns>
        public static insertResponse NewServer(NetworkCredential Credential, insert Server, string ServiceNowUrl)
        {
            try
            {
                string userName = Credential.UserName;
                string userPass = Credential.Password;
                ServiceNowSoapClient client = soapClient(userName, userPass, ServiceNowUrl);

                insertResponse response = new insertResponse();

                if (!(itemExist(client, Server.name)))
                {
                    response = client.insert(Server);
                }
                return response;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 23
0
        /// <summary>
        /// This function inserts a server into the ServiceNow CI Database
        /// </summary>
        /// <param name="Credential">A NetworkCredential object that gets passed to the soap client for authentication</param>
        /// <param name="Server">An insert object that contains the data to be inserted into ServiceNOW</param>
        /// <returns>An insertResponse object containing data returned from ServiceNOW</returns>
        public static insertResponse NewServer(NetworkCredential Credential, insert Server, string ServiceNowUrl)
        {
            try
            {
                string userName             = Credential.UserName;
                string userPass             = Credential.Password;
                ServiceNowSoapClient client = soapClient(userName, userPass, ServiceNowUrl);

                insertResponse response = new insertResponse();

                if (!(itemExist(client, Server.name)))
                {
                    response = client.insert(Server);
                }
                return(response);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 24
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new frmLogin());

            login = new frmLogin();
            Application.Run(login);

            if (logOK)
            {
                frmMain m = new frmMain();
                //login.Close();
                Application.Run(m);
            }
            if (inOK)
            {
                insert newin = new insert();
                login.Close();                                                  //version22222
                Application.Run(newin);
            }
        }
Esempio n. 25
0
        private void cmdSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                NetworkCredential Credential = new NetworkCredential(txtUsername.Text, txtPassword.Text);

                insert newIncident = new insert();
                newIncident.caller_id = txtUser.Text;
                newIncident.opened_by = txtUser.Text;
                newIncident.watch_list = txtUser.Text;
                newIncident.contact_type = "Email";
                newIncident.short_description = txtShortDescription.Text;
                newIncident.description = txtDescription.Text;

                insertResponse response = incident.Incident.NewIncident(Credential, newIncident, txtUrl.Text);
                MessageBox.Show(response.number);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 26
0
        private void cmdSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                NetworkCredential Credential = new NetworkCredential(txtUsername.Text, txtPassword.Text);

                insert newIncident = new insert();
                newIncident.caller_id         = txtUser.Text;
                newIncident.opened_by         = txtUser.Text;
                newIncident.watch_list        = txtUser.Text;
                newIncident.contact_type      = "Email";
                newIncident.short_description = txtShortDescription.Text;
                newIncident.description       = txtDescription.Text;

                insertResponse response = incident.Incident.NewIncident(Credential, newIncident, txtUrl.Text);
                MessageBox.Show(response.number);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 27
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Session["admin_id"] = "1";

                product p = new product();
                p.pro_name        = TextBox1.Text;
                p.pro_date        = TextBox2.Text;
                p.pro_price       = Convert.ToDecimal(TextBox3.Text);
                p.pro_img         = img_upload(FileUpload3, Session["admin_id"].ToString());
                p.pro_adminid_fk  = Convert.ToInt32(Session["admin_id"].ToString());
                p.pro_subcatid_fk = Convert.ToInt32(DropDownList2.SelectedValue.ToString());

                insert i = new insert();
                string k = i.insert_tblproduct(p);
                if (k == "-1")
                {
                    Label2.Text = "TRY AGAIN ....";
                }
                else
                {
                    if (DropDownList1.SelectedIndex == 1 && DropDownList2.SelectedIndex == 1)
                    {
                        HyperLink1.NavigateUrl = "~/Womens/WomensShoes.aspx";
                    }
                    else if (DropDownList1.SelectedIndex == 1 && DropDownList2.SelectedIndex == 2)
                    {
                        HyperLink1.NavigateUrl = "~/Womens/WomensCoats.aspx";
                    }
                    else if (DropDownList1.SelectedIndex == 1 && DropDownList2.SelectedIndex == 3)
                    {
                        HyperLink1.NavigateUrl = "~/Womens/WomensTop.aspx";
                    }

                    else if (DropDownList1.SelectedIndex == 2 && DropDownList2.SelectedIndex == 1)
                    {
                        HyperLink1.NavigateUrl = "~/Mens/MensJeans.aspx";
                    }
                    else if (DropDownList1.SelectedIndex == 2 && DropDownList2.SelectedIndex == 2)
                    {
                        HyperLink1.NavigateUrl = "~/Mens/MensJackets.aspx";
                    }
                    else
                    {
                        Label2.Text = "Add not available for view";
                    }

                    Label2.Text = "Ad successfully posted!";

                    HyperLink1.Visible = true;
                    HyperLink1.Text    = " View Add Online";

                    TextBox1.Text = "";

                    TextBox3.Text = "";
                    DropDownList1.SelectedIndex = 0;
                    drop2Changed();
                    DropDownList2.Enabled       = false;
                    DropDownList2.SelectedIndex = 0;



                    //Response.Redirect("~/AdminAccount/AdminPannel.aspx");
                }
            }
        }
Esempio n. 28
0
 //新增操作
 public int InsertOperation(XmlDocument PCD)
 {
     Log = LogManager.GetCurrentClassLogger();
     //把XmlDocument轉換成XDocument
     this.PCDXml = XDocument.Parse(PCD.OuterXml);
     //負責填質的部分
     FillFrontSection(PCDXml);
     FillLaterSection(PCDXml);
     XDocument FullInsertXml = FinalSection();
     //把結果給學弟
     // alternatively you can call the Log() method
     // and pass log level as the parameter.
     Log.Log(LogLevel.Info, "Sample informational message");
     try
     {
         insert InsertFun = new insert();
         InsertFun.ProcessXML(FullInsertXml);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.GetBaseException());
     }
     return 200;
 }