Ejemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DLL.Model.repair model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into repair(");
            strSql.Append("computerId,defineId,adminId,adminname,ftype,result,addTime)");
            strSql.Append(" values (");
            strSql.Append("@computerId,@defineId,@adminId,@adminname,@ftype,@result,@addTime)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@computerId", SqlDbType.Int,4),
                    new SqlParameter("@defineId", SqlDbType.VarChar,500),
                    new SqlParameter("@adminId", SqlDbType.Int,4),
                    new SqlParameter("@adminname", SqlDbType.VarChar,500),
                    new SqlParameter("@ftype", SqlDbType.VarChar,500),
                    new SqlParameter("@result", SqlDbType.VarChar),
                    new SqlParameter("@addTime", SqlDbType.DateTime)};
            parameters[0].Value = model.computerId;
            parameters[1].Value = model.defineId;
            parameters[2].Value = model.adminId;
            parameters[3].Value = model.adminname;
            parameters[4].Value = model.ftype;
            parameters[5].Value = model.result;
            parameters[6].Value = System.DateTime.Now;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DLL.Model.admin model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into admin(");
            strSql.Append("username,tel,userId,password)");
            strSql.Append(" values (");
            strSql.Append("@username,@tel,@userId,@password)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@username", SqlDbType.VarChar,500),
                    new SqlParameter("@tel", SqlDbType.VarChar,500),
                    new SqlParameter("@userId", SqlDbType.VarChar,500),
                    new SqlParameter("@password", SqlDbType.VarChar,500)};
            parameters[0].Value = model.username;
            parameters[1].Value = model.tel;
            parameters[2].Value = model.userId;
            parameters[3].Value = DLL.TOOL.Strings.Encrypt(model.password);

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
 public int insertRebaja(DLL.RebajarStock r)
 {
     //Insertará en la BD la rebaja, esto retornará un número el cual indicará el resultado de la consulta
     string insert = "INSERT INTO rebajarStock VALUES (" + r.IdRebajarStock + "," + r.IdItem + ","
                   +  r.IdLocal + "," + r.Cantidad + ",'" + r.Fecha + "'," + r.NroGuia + ",'" + r.FechaGuia + "');";
     return b.executecommand(insert);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DLL.Model.loginfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into loginfo(");
            strSql.Append("addTime,adminname,action,objectname)");
            strSql.Append(" values (");
            strSql.Append("@addTime,@adminname,@action,@objectname)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@addTime", SqlDbType.DateTime),
                    new SqlParameter("@adminname", SqlDbType.VarChar,500),
                    new SqlParameter("@action", SqlDbType.VarChar,500),
                    new SqlParameter("@objectname", SqlDbType.VarChar,500)};
            parameters[0].Value = System.DateTime.Now;
            parameters[1].Value = model.adminname;
            parameters[2].Value = model.action;
            parameters[3].Value = model.objectname;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DLL.Model.admin model)
 {
     int adminid = dal.Add(model);
     if (adminid != 0)
     {
         loginfo.adminname = System.Web.HttpContext.Current.Session["Username"].ToString();
         loginfo.action = "添加";
         loginfo.objectname = "管理员:" + model.username;
         new DLL.BLL.loginfo().Add(loginfo);
     }
     return adminid;
 }
Ejemplo n.º 6
0
 public byte ReadEEPROM(int address)
 {
     if (address >= 0 && address < DLL.EEPROM_size())
     {
         return(DLL.EEPROM_read(address));
     }
     else
     {
         // Reading outside the memory
         return(0);
     }
 }
Ejemplo n.º 7
0
        public JsonResult List()
        {
            DLL           objDB       = new DLL();
            AdminQuestion objCustomer = new AdminQuestion();
            HttpClient    cons        = new HttpClient();

            cons.BaseAddress = new Uri("http://localhost:62904/");
            cons.DefaultRequestHeaders.Accept.Clear();
            cons.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            MyAPIGet(cons).Wait();
            return(Json(objCustomer.ShowallQuestion = objDB.Selectalldata(), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
 static Daisy GetInitDaisy()
 {
     Daisy daisy = new Daisy();
     daisy.ParseFile("../../DaisyData/test_check.dai");
     if(DLL.daisy_daisy_done(daisy.daisy))
     {
         DLL.daisy_daisy_delete(daisy.daisy);
         throw new ApplicationException("No daisy");
     }
     daisy.Initialize();
     return daisy;
 }
Ejemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        DLL.KCPUpdate(sess);

        var bufRecv = new byte[1024];

        DLL.Read(sess, bufRecv, 1024);

        //update game logic

        DLL.Write(sess, bufRecv, 1024 /*datelen*/);
    }
    public void BindGridview()
    {
        string[] UserName    = new string[1];
        string[] ColumnNames = new string[1];
        DataSet  ds          = new DataSet("test");
        DLL      objDLL      = new DLL();

        ColumnNames[0]       = "usname";
        UserName[0]          = "user";
        ds                   = objDLL.GrabValues("cmp", ColumnNames, UserName);
        gvDetails.DataSource = ds;
        gvDetails.DataBind();
    }
Ejemplo n.º 11
0
        public LRUCache(int capacity)
        {
            numDict   = new Dictionary <int, DLL>();
            count     = 0;
            maxCount  = capacity;
            head      = new DLL();
            head.left = null;

            tail       = new DLL();
            tail.left  = head;
            tail.right = null;
            head.right = tail;
        }
    void OnAudioFilterRead(out float[] data, int channels)
    {
        int[]  destination = new int[channels];
        IntPtr buffer      = Marshal.AllocHGlobal(4 * channels);

        DLL.RTcmix_runAudio((IntPtr)0, buffer, channels);

        Marshal.Copy(buffer, destination, 0, channels);

        Marshal.FreeHGlobal(buffer);

        data = destination.Select(item => (float)item).ToArray();
    }
Ejemplo n.º 13
0
    public void SendScore(String score, int objno)
    {
        IntPtr sptr = Marshal.StringToHGlobalAnsi(score);

        unsafe {
            while (DLL.check_context() == 1)
            {
                System.Threading.Thread.Sleep(1);
            }
            DLL.unity_parse_score((char *)sptr.ToPointer(), score.Length, objno);
        }
        Marshal.FreeHGlobal(sptr);
    }
Ejemplo n.º 14
0
 private void Chat_Load(object sender, EventArgs e)
 {
     try
     {
         DLL.LoadMessages(dgvChat);
         hlpChat.HelpNamespace = Application.StartupPath + "\\HelpFile.chm";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "An Unexpected Error Occured (Chat).", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Ejemplo n.º 15
0
 private void frmAdmin_Load(object sender, EventArgs e)
 {
     try
     {
         DLL.AccountInfo(lblIDText, lblFirstNameText, lblLastNameText, lblAgeText, lblStateText, lblCityText, lblAddressText, lblZipText, lblGradText, lblWorkText, lblSalaryText, lblEducationText, lblStoryText, pbxPhoto);
         hlpAdmin.HelpNamespace = Application.StartupPath + "\\HelpFile.chm";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "An Unexpected Error Occured (Admin).", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Ejemplo n.º 16
0
        public ActionResult ShowAllQuestions()
        {
            // var bytes = new UTF8Encoding().GetBytes("");
            //var hashBytes = System.Security.Cryptography.MD5.Create().ComputeHash(bytes);


            AdminQuestion objCustomer = new AdminQuestion();
            DLL           objDB       = new DLL(); //calling class DBdata

            objCustomer.ShowallQuestion = objDB.Selectalldata();
            ViewBag.ShowDetails         = false;
            return(View(objCustomer));
        }
Ejemplo n.º 17
0
 public void Loop()
 {
     DLL.Sketch_loop();
     EnqueueSerial();
     if (stats != null)
     {
         stats.Add(new RuntimeStats()
         {
             UsedMemory             = DLL.Stats_usedMemory(),
             CoroutineResizeCounter = DLL.Stats_coroutineResizeCounter()
         });
     }
 }
Ejemplo n.º 18
0
        private void OnEvent_ResultImageEx(int deviceHandle, IntPtr pContext, int imageStatus, DLL.IBSU_ImageData image, DLL.IBSU_ImageType imageType, int detectedFingerCount, int segmentImageArrayCount, IntPtr pSegmentImageArray, IntPtr pSegmentPositionArray)
        {
            if (this.InvokeRequired == true)
            {
                this.BeginInvoke(new OnEvent_ResultImageExThreadSafe(OnEvent_ResultImageEx), new object[] { deviceHandle, pContext, imageStatus, image, imageType, detectedFingerCount, segmentImageArrayCount, pSegmentImageArray, pSegmentPositionArray });
            }
            else
            {
                if (pContext == null)
                {
                    return;
                }
                else
                {
                    try
                    {
                        pvtblnNeedClearPlaten   = true;
                        pvtblnCaptureInProgress = false;

                        DLL._IBSU_SetLEDs(m_nDevHandle, DLL.IBSU_LED_NONE);

                        if (myPictureBox != null)
                        {
                            if (pvtstrDeviceDesc == "COLUMBO")
                            {
                                //NB pvtbyteArrayFiv is Created in Write_Columbo_Image
                                Write_Columbo_Image(image.Buffer, true);
                            }
                            else
                            {
                                //NB pvtbyteArrayFiv is Created in Write_Curve_Image
                                Write_Curve_Image(image.Buffer, true);
                            }

                            DPUruNet.Fid myFid = DPUruNet.Importer.ImportFid(pvtbyteArrayFiv, Constants.Formats.Fid.ANSI).Data;

                            CaptureResult CaptureResultNew = new CaptureResult(Constants.ResultCode.DP_SUCCESS, Constants.CaptureQuality.DP_QUALITY_GOOD, 0, myFid);

                            OnCaptured(CaptureResultNew);

                            myFid            = null;
                            CaptureResultNew = null;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("OnEvent_ResultImage ex = " + ex.Message);
                    }
                }
            }
        }
Ejemplo n.º 19
0
 private void frmViewProfiles_Load(object sender, EventArgs e)
 {
     try
     {
         DLL.LoadAll(lblIDText, lblFirstNameText, lblLastNameText, lblAgeText, lblStateText, lblCityText, lblAddressText, lblZipText, lblGradText, lblWorkText, lblSalaryText, lblEducationText, lblStoryText, pbxPhoto);
         hlpProfile.HelpNamespace = Application.StartupPath + "\\HelpFile.chm";
         accountManager           = (CurrencyManager)this.BindingContext[DLL.Account];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "An Unexpected Error Occured (View Account).", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Ejemplo n.º 20
0
        //this is
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            LayoutInflater inflater = LayoutInflater.From(parent.Context);

            View view = convertView;

            Bindings binding = DLL.GetBindingByReference(FormControls[position].reference);

            //what form of control it is
            switch ((ControlType)FormControls[position].type)
            {
            case ControlType.input:
                //the user puts something in
                //view = WidgetHelper.CreateInput(FormControls[position], binding, inflater, fActivity, this);

                break;

            case ControlType.output:
                Console.WriteLine("not yet");
                view = new LinearLayout(parent.Context);
                view.SetBackgroundColor(Color.Red);
                view.SetMinimumHeight(25);


                break;

            case ControlType.select:
                //view = WidgetHelper.CreateSelect(FormControls[position], binding, inflater, fActivity, this);


                break;

            case ControlType.select1:
                //view = WidgetHelper.CreateSelectOne(FormControls[position], binding, inflater, fActivity, this);


                break;

            case ControlType.upload:
                Console.WriteLine("not yet");
                view = new LinearLayout(parent.Context);
                view.SetBackgroundColor(Color.Blue);
                view.SetMinimumHeight(25);
                break;
            }


            ControlViews.Add(view);
            return(view);
        }
Ejemplo n.º 21
0
 private void EnqueueSerial()
 {
     lock (serial_lock)
     {
         byte[] buffer = new byte[1024];
         int    count  = DLL.Serial_readInto(buffer, buffer.Length);
         byte[] read   = buffer.Take(count).ToArray();
         if (read.Length > 0)
         {
             Tuple <DateTime, byte[]> tuple = new Tuple <DateTime, byte[]>(DateTime.Now, read);
             serial.Enqueue(tuple);
             SerialReceived(tuple);
         }
     }
 }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string cid = Request.QueryString["id"];

        string[] Values      = new string[1];
        string[] ColumnNames = new string[1];
        DataSet  ds          = new DataSet("test");
        DLL      objDLL      = new DLL();

        Values[0]      = cid;
        ColumnNames[0] = "complain_id";
        ds             = objDLL.GrabValues("cmp_display", ColumnNames, Values);
        lblReason.Text = ds.Tables[0].Rows[0][2].ToString();
        lblFor.Text    = ds.Tables[0].Rows[0][1].ToString();
    }
Ejemplo n.º 23
0
 private void loadIcons()
 {
     Debug.Log("Resources in problemfinder:\n" + DLL.listAllResources());
     if (icoBulb == null)
     {
         icoBulb = DLL.LoadImageResource("GameDevProfi.Resources.bulb.png", 16, 16, Color.magenta, GetType().Assembly);
     }
     if (icoProblem == null)
     {
         icoProblem = DLL.LoadImageResource("GameDevProfi.Resources.exclam.png", 16, 16, Color.magenta, GetType().Assembly);
     }
     if (icoOk == null)
     {
         icoOk = DLL.LoadImageResource("GameDevProfi.Resources.bullet-ok.png", 16, 16, Color.magenta, GetType().Assembly);
     }
 }
Ejemplo n.º 24
0
 public ActionResult Test(AdminQuestion AdqAnswer)
 {
     if (ModelState.IsValid) //checking model is valid or not
     {
         DLL objDB  = new DLL();
         int result = objDB.InsertQuestion(AdqAnswer);
         ModelState.Clear(); //clearing model
         ModelState.AddModelError("", "Record Added Successfully");
         return(View());
     }
     else
     {
         ModelState.AddModelError("", "Error in saving data");
         return(View());
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     lblVisitorID.Text = Request.QueryString["Id"];
     Retriew_Visitor_Data();
     getSecCheck();
     if (c == 1)
     {
         string[] Values2      = new string[1];
         string[] ColumnNames2 = new string[1];
         DataSet  ds2          = new DataSet("test");
         DLL      objDLL       = new DLL();
         Values2[0]      = lblVisitorID.Text;
         ColumnNames2[0] = "v_id";
         ds2             = objDLL.GrabValues("makerev", ColumnNames2, Values2);
     }
 }
Ejemplo n.º 26
0
 private void ScreenCapture()
 {
     if (!appendMode)
     {
         this.textBox1.Text = "";
     }
     if (DLL.PrScrn() == 1)
     {
         if (Clipboard.ContainsImage())
         {
             message("处理截图中...", Color.Green);
             Image        SnapImg   = Clipboard.GetImage();
             MemoryStream ImgStream = new MemoryStream(0);
             if (SnapImg != null)
             {
                 try
                 {
                     SnapImg.Save(ImgStream, ImageFormat.Jpeg);
                     List <string> tempResult = ocrTools.accurateBasic(ImgStream);
                     foreach (string line in tempResult)
                     {
                         this.textBox1.AppendText(line + Environment.NewLine);
                     }
                     message("转换完成", Color.Green);
                     CopyClipboard();
                 }
                 catch (Exception err)
                 {
                     MessageBox.Show("处理截图文件流失败" + err.ToString());
                 }
             }
             else
             {
                 message("错误,无法获取截图", Color.Red);
             }
             ImgStream.Close();
         }
         else
         {
             message("错误,无法捕获截图", Color.Red);
         }
     }
     else
     {
         message("用户取消截图", Color.Red);
     }
 }
Ejemplo n.º 27
0
 private void btnSavePhoto_Click(object sender, EventArgs e)
 {
     if (validPhoto == true)
     {
         try
         {
             DLL.EditPhoto(txtID.Text, image);
             DLL.LogChanges(txtID.Text, txtFirstName.Text, txtLastName.Text, txtAge.Text, txtState.Text, txtCity.Text, txtAddress.Text, txtZip.Text, txtGradutated.Text, txtAdmin.Text, txtWork.Text, txtSalary.Text, txtEducation.Text, txtStory.Text, txtShare.Text);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "An unexpected error occured while saving changes.", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         Disable();
     }
 }
Ejemplo n.º 28
0
 private void frmEditStudent_Load(object sender, EventArgs e)
 {
     try
     {
         DLL.LoadAccounts(txtID, txtPassword, txtFirstName, txtLastName, txtAge, txtState, txtCity, txtAddress, txtZip, txtGradutated, txtAdmin, txtWork, txtSalary, txtEducation, txtStory, txtShare, pbxPhoto);
         hlpEdit.HelpNamespace = Application.StartupPath + "\\HelpFile.chm";
         accountManager        = (CurrencyManager)this.BindingContext[DLL.Account];
         txtID.Enabled         = false;
         txtFirstName.Focus();
         Disable();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "An Unexpected Error Occured (Edit Account).", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Ejemplo n.º 29
0
        public void AddPageStub(int groupid, int?sectionID)
        {
            LinearLayout groupParent;
            LinearLayout groupLayout;

            //string parentName;
            //parentName = sectionID.Value;

            RunOnUiThread(() => {
                Groups group = DLL.GetGroup(groupid);
                //this could either be the MainFormLayout or a Group
                //groupParent = (LinearLayout)MainFormLayout.FindViewWithTag(parentName);

                View pageItem = inflater.Inflate(Resource.Layout.pageButton, null);

                Button pageButton = pageItem.FindViewById <Button>(Resource.Id.pageButton);
                pageButton.Text   = group.label;
                pageButton.Tag    = groupid;

                pageButton.Click += PageButton_Click;

                try
                {
                    //on the root layout
                    if (sectionID == null || sectionID == -1)
                    {
                        groupParent = (LinearLayout)MainFormLayout.FindViewWithTag("mainView");
                        groupParent.AddView(pageItem);
                        //RunOnUiThread(() => { groupParent.AddView(pageItem); });
                    }
                    //inside a group
                    else
                    {
                        groupParent = (LinearLayout)MainFormLayout.FindViewWithTag(sectionID.Value);
                        groupLayout = groupParent.FindViewById <LinearLayout>(Resource.Id.mainGroupLayout);
                        groupLayout.AddView(pageItem);
                        //RunOnUiThread(() => { groupLayout.AddView(pageItem); });
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Failed to add page {groupid} on {sectionID}");
                    Console.WriteLine(ex.ToString());
                }
            });
        }
    protected void SecNAH_Click(object sender, EventArgs e)
    {
        string[] Values      = new string[1];
        string[] ColumnNames = new string[1];
        DataSet  ds          = new DataSet("test");
        DLL      objDLL      = new DLL();

        Values[0]      = vid.Text;
        ColumnNames[0] = "vid";
        try
        {
            ds = objDLL.GrabValues("NoResponse", ColumnNames, Values);
        }
        catch
        {
        }
    }
Ejemplo n.º 31
0
    protected void Page_Load(object sender, EventArgs e)
    {
        uname.Text = Request.QueryString["id"];
        if (Request.Cookies["collector"] != null)
        {
            HttpCookie insert = Request.Cookies["collector"];
            checkdetails2 = Int32.Parse(insert.Value);
        }
        lbltext.Text = "0";

        gvDetails.ControlStyle.Font.Size = 20;

        if (Request.Cookies["collector1"] != null)
        {
            HttpCookie insert1 = Request.Cookies["collector1"];
            notify1 = Int32.Parse(insert1.Value);
        }

        BindGridview();
        if (nov != 1)
        {
            if (checkdetails1 > checkdetails2)
            {
                tgmeta.Attributes["content"] = "17";
                lbltext.Text = "1";
            }
        }
        string[] UserName    = new string[1];
        string[] ColumnNames = new string[1];
        DataSet  ds          = new DataSet("test");
        DLL      objDLL      = new DLL();

        ColumnNames[0] = "username";
        UserName[0]    = uname.Text;
        ds             = objDLL.GrabValues("ntcnotification", ColumnNames, UserName);
        try
        {
            notify2 = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
        }
        catch { }
        if (notify1 < notify2)
        {
            int index = notify2 - notify1;
            Notice.Text = "Notice(" + index + ")";
        }
    }
    protected void Complain_Click(object sender, EventArgs e)
    {
        string[] Values      = new string[2];
        string[] ColumnNames = new string[2];
        DataSet  ds          = new DataSet("test");
        DLL      objDLL      = new DLL();

        Values[0]      = txtwing.Text;
        ColumnNames[0] = "wing_no";
        Values[1]      = txtflatno.Text;
        ColumnNames[1] = "flat_no";
        ds             = objDLL.GrabValues("vlist", ColumnNames, Values);

        gvDetails.DataSource = ds;
        gvDetails.DataBind();
        gvDetails.ControlStyle.Font.Size = 20;
    }
    public void getSecCheck()
    {
        string[] Values1      = new string[1];
        string[] ColumnNames1 = new string[1];
        DataSet  ds1          = new DataSet("test");
        DLL      objDLL       = new DLL();

        Values1[0]      = lblVisitorID.Text;
        ColumnNames1[0] = "v_id";
        ds1             = objDLL.GrabValues("seccheck", ColumnNames1, Values1);
        int a = Int32.Parse(ds1.Tables[0].Rows[0][0].ToString());

        if (a == 0)
        {
            hide.Attributes["class"] = "hidden";
            c = 1;
        }
    }
    public void Displaydetails()
    {
        string[] Values      = new string[1];
        string[] ColumnNames = new string[1];
        DataSet  ds1         = new DataSet("test");
        DLL      objDLL      = new DLL();

        Values[0]      = Session["vid"].ToString();
        ColumnNames[0] = "v_id";
        try
        {
            ds1 = objDLL.GrabValues("getack", ColumnNames, Values);
        }
        catch
        {
        }
        ack.Text = ds1.Tables[0].Rows[0][0].ToString();
    }
Ejemplo n.º 35
0
    public int checkvalsRTcmix(out float[] farray, int objno)
    {
        farray = new float[1024];
        int nvals;

        unsafe
        {
            fixed(float *vptr = farray)
            {
                while (DLL.check_context() == 1)
                {
                    System.Threading.Thread.Sleep(1);
                }
                nvals = DLL.unity_checkForVals(vptr, objno);
            }
        }
        return(nvals);
    }
Ejemplo n.º 36
0
        public bool addcomputers(DLL.Model.computer model,int num)
        {
            model.roomNum = "0000";
            model.mac = "00-00-00-00-00-00";
            model.department = "请选择";
            model.nettype = "请选择";
            model.outerIP = "0.0.0.0";
            model.innerIP = "0.0.0.0";
            model.printerInfo = "空";
            model.scannerInfo = "空";
            model.screenInfo = "空";
            model.description = "空";
            model.username = "******";

            if (num > 0)
            {
                do
                {
                    Add(model);
                    num--;
                } while (num > 0);
            }
            return false;
        }
Ejemplo n.º 37
0
 public int insertItem(DLL.Item i)
 {
     string insert = "INSERT INTO item VALUES(" + i.IdItem + ",'" + i.Descripcion + "'," + i.IdArticulo + ");";
     return b.executecommand(insert);
 }
Ejemplo n.º 38
0
 public int modificarItem(DLL.Item i)
 {
     string sql = "UPDATE item SET descripcion = '" + i.Descripcion + "', idArticulo = " + i.IdArticulo + " WHERE idItem = " + i.IdItem + ";";
     return b.executecommand(sql);
 }
Ejemplo n.º 39
0
 public int insertCC(DLL.CentroCosto cc)
 {
     string sql = "INSERT INTO centroCosto VALUES(" + cc.IdCC + ",'" + cc.Nombre + "'," + cc.IdEmpresa + ");";
         return b.executecommand(sql);
 }
Ejemplo n.º 40
0
 public int modificarCC(DLL.CentroCosto c, int idLocalOriginal)
 {
     string sql = "UPDATE centroCosto SET idLocal = '" + c.IdCC + "', nombreCentroCosto = '" + c.Nombre + "', idEmpresa = " + c.IdEmpresa + "  WHERE Idlocal = " + idLocalOriginal + ";";
     return b.executecommand(sql);
 }
Ejemplo n.º 41
0
 public int insertCompra(DLL.Compra c)
 {
     string insert = "INSERT INTO compras VALUES(" + c.IdCompra + "," + c.NumeroDoc + ",'" + c.Fecha + "'," + c.IdArticulo + "," + c.IdItem + "," + c.Cantidad + "," + c.Precio + ");";
     return b.executecommand(insert);
 }
Ejemplo n.º 42
0
 public int insertArt(DLL.Articulo a)
 {
     string sql = "INSERT INTO articulo VALUES(" + a.IdArticulo + ",'" + a.NombreArticulo + "');";
     return b.executecommand(sql);
 }
Ejemplo n.º 43
0
 public int modificarRegistro(DLL.Insumo i)
 {
     string sql = "UPDATE insumos SET nroGuia = " + i.NroGuia + ", fechaGuia = '" + i.FechaGuia + "', cantidad = " + i.Cantidad + " , idLocal = " + i.IdLocal + " WHERE idInsumos = " + i.IdInsumos + ";";
     return b.executecommand(sql);
 }
Ejemplo n.º 44
0
    private DLL.User GetUserByUser(DLL.User user)
    {
        SetOfBookType setOfBook = GetSetOfBook(); 

        DLL.User u = null;

        if (user != null)
        {

            DatabaseAdapter sqlHelper = new DatabaseAdapter(setOfBook);

            string sql = "select * from T_User where 1=0 ";

            if (!string.IsNullOrEmpty(user.Code))
            {

                sql += string.Format(" or Code = '{0}'", user.Code);

            }


            DataSet ds = new DataSet();

            sqlHelper.DbHelper.Fill(ds, CommandType.Text, sql, null);

            if (

                ds != null && ds.Tables != null

                && ds.Tables[0] != null

                && ds.Tables[0].Rows != null

                && ds.Tables[0].Rows.Count > 0

                )
            {

                u = DLL.User.GetEntityFromDataRow(ds.Tables[0].Rows[0]);

            }

        }

        return u;

    }
Ejemplo n.º 45
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DLL.Model.loginfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update loginfo set ");
            strSql.Append("addTime=@addTime,");
            strSql.Append("adminname=@adminname,");
            strSql.Append("action=@action,");
            strSql.Append("objectname=@objectname");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@addTime", SqlDbType.DateTime),
                    new SqlParameter("@adminname", SqlDbType.VarChar,500),
                    new SqlParameter("@action", SqlDbType.VarChar,500),
                    new SqlParameter("@objectname", SqlDbType.VarChar,500),
                    new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = model.addTime;
            parameters[1].Value = model.adminname;
            parameters[2].Value = model.action;
            parameters[3].Value = model.objectname;
            parameters[4].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Ejemplo n.º 46
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DLL.Model.admin model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update admin set ");
            strSql.Append("username=@username,");
            strSql.Append("tel=@tel,");
            strSql.Append("userId=@userId,");
            strSql.Append("password=@password");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@username", SqlDbType.VarChar,500),
                    new SqlParameter("@tel", SqlDbType.VarChar,500),
                    new SqlParameter("@userId", SqlDbType.VarChar,500),
                    new SqlParameter("@password", SqlDbType.VarChar,500),
                    new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = model.username;
            parameters[1].Value = model.tel;
            parameters[2].Value = model.userId;
            parameters[3].Value = model.password;
            parameters[4].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Ejemplo n.º 47
0
 public int insertEmpresa(DLL.Empresa e)
 {
     string sql = "INSERT INTO empresas VALUES(" + e.IdEmpresa + ",'" + e.Nombre + "');";
     return b.executecommand(sql);
 }
Ejemplo n.º 48
0
 public DataSet searchCom(DLL.Model.computer model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select * from computer where 1=1");
     if (model.defineId != null)
     {
         strSql.Append("and defineId = ");
     }
     return DbHelperSQL.Query(strSql.ToString());
 }
Ejemplo n.º 49
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DLL.Model.computer model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into computer(");
            strSql.Append("defineId,type,brand,version,mac,nettype,innerIP,outerIP,screenInfo,printerInfo,scannerInfo,roomNum,department,username,addId,addtime,updateId,updateTime,description,flag,buyTime,giveTime)");
            strSql.Append(" values (");
            strSql.Append("@defineId,@type,@brand,@version,@mac,@nettype,@innerIP,@outerIP,@screenInfo,@printerInfo,@scannerInfo,@roomNum,@department,@username,@addId,@addtime,@updateId,@updateTime,@description,@flag,@buyTime,@giveTime)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@defineId", SqlDbType.VarChar,500),
                    new SqlParameter("@type", SqlDbType.VarChar,500),
                    new SqlParameter("@brand", SqlDbType.VarChar,500),
                    new SqlParameter("@version", SqlDbType.VarChar,500),
                    new SqlParameter("@mac", SqlDbType.VarChar,500),
                    new SqlParameter("@nettype", SqlDbType.VarChar,500),
                    new SqlParameter("@innerIP", SqlDbType.VarChar,500),
                    new SqlParameter("@outerIP", SqlDbType.VarChar,500),
                    new SqlParameter("@screenInfo", SqlDbType.VarChar),
                    new SqlParameter("@printerInfo", SqlDbType.VarChar),
                    new SqlParameter("@scannerInfo", SqlDbType.VarChar),
                    new SqlParameter("@roomNum", SqlDbType.VarChar,500),
                    new SqlParameter("@department", SqlDbType.VarChar,500),
                    new SqlParameter("@username", SqlDbType.VarChar,500),
                    new SqlParameter("@addId", SqlDbType.Int,4),
                    new SqlParameter("@addtime", SqlDbType.DateTime),
                    new SqlParameter("@updateId", SqlDbType.Int,4),
                    new SqlParameter("@updateTime", SqlDbType.DateTime),
                    new SqlParameter("@description", SqlDbType.VarChar),
                    new SqlParameter("@flag", SqlDbType.Int,4),
                    new SqlParameter("@buyTime", SqlDbType.DateTime),
                    new SqlParameter("@giveTime", SqlDbType.DateTime)};
            parameters[0].Value = model.defineId;
            parameters[1].Value = model.type;
            parameters[2].Value = model.brand;
            parameters[3].Value = model.version;
            parameters[4].Value = model.mac;
            parameters[5].Value = model.nettype;
            parameters[6].Value = model.innerIP;
            parameters[7].Value = model.outerIP;
            parameters[8].Value = model.screenInfo;
            parameters[9].Value = model.printerInfo;
            parameters[10].Value = model.scannerInfo;
            parameters[11].Value = model.roomNum;
            parameters[12].Value = model.department;
            parameters[13].Value = model.username;
            parameters[14].Value = model.addId;
            parameters[15].Value = System.DateTime.Now;
            parameters[16].Value = model.updateId;
            parameters[17].Value = System.DateTime.Now;
            parameters[18].Value = model.description;
            parameters[19].Value = model.flag;
            parameters[20].Value = model.buyTime;
            parameters[21].Value = model.giveTime;
            if (model.buyTime == null)
            {
                parameters[20].Value = System.DateTime.Now;
            }
            if (model.giveTime == null)
            {
                parameters[21].Value = System.DateTime.MaxValue;
            }

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Ejemplo n.º 50
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DLL.Model.computer model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update computer set ");
            strSql.Append("defineId=@defineId,");
            strSql.Append("type=@type,");
            strSql.Append("brand=@brand,");
            strSql.Append("version=@version,");
            strSql.Append("mac=@mac,");
            strSql.Append("nettype=@nettype,");
            strSql.Append("innerIP=@innerIP,");
            strSql.Append("outerIP=@outerIP,");
            strSql.Append("screenInfo=@screenInfo,");
            strSql.Append("printerInfo=@printerInfo,");
            strSql.Append("scannerInfo=@scannerInfo,");
            strSql.Append("roomNum=@roomNum,");
            strSql.Append("department=@department,");
            strSql.Append("username=@username,");
            strSql.Append("addId=@addId,");
            strSql.Append("addtime=@addtime,");
            strSql.Append("updateId=@updateId,");
            strSql.Append("updateTime=@updateTime,");
            strSql.Append("description=@description,");
            strSql.Append("flag=@flag,");
            strSql.Append("buyTime=@buyTime,");
            strSql.Append("giveTime=@giveTime");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@defineId", SqlDbType.VarChar,500),
                    new SqlParameter("@type", SqlDbType.VarChar,500),
                    new SqlParameter("@brand", SqlDbType.VarChar,500),
                    new SqlParameter("@version", SqlDbType.VarChar,500),
                    new SqlParameter("@mac", SqlDbType.VarChar,500),
                    new SqlParameter("@nettype", SqlDbType.VarChar,500),
                    new SqlParameter("@innerIP", SqlDbType.VarChar,500),
                    new SqlParameter("@outerIP", SqlDbType.VarChar,500),
                    new SqlParameter("@screenInfo", SqlDbType.VarChar),
                    new SqlParameter("@printerInfo", SqlDbType.VarChar),
                    new SqlParameter("@scannerInfo", SqlDbType.VarChar),
                    new SqlParameter("@roomNum", SqlDbType.VarChar,500),
                    new SqlParameter("@department", SqlDbType.VarChar,500),
                    new SqlParameter("@username", SqlDbType.VarChar,500),
                    new SqlParameter("@addId", SqlDbType.Int,4),
                    new SqlParameter("@addtime", SqlDbType.DateTime),
                    new SqlParameter("@updateId", SqlDbType.Int,4),
                    new SqlParameter("@updateTime", SqlDbType.DateTime),
                    new SqlParameter("@description", SqlDbType.VarChar),
                    new SqlParameter("@flag", SqlDbType.Int,4),
                    new SqlParameter("@buyTime", SqlDbType.DateTime),
                    new SqlParameter("@giveTime", SqlDbType.DateTime),
                    new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = model.defineId;
            parameters[1].Value = model.type;
            parameters[2].Value = model.brand;
            parameters[3].Value = model.version;
            parameters[4].Value = model.mac;
            parameters[5].Value = model.nettype;
            parameters[6].Value = model.innerIP;
            parameters[7].Value = model.outerIP;
            parameters[8].Value = model.screenInfo;
            parameters[9].Value = model.printerInfo;
            parameters[10].Value = model.scannerInfo;
            parameters[11].Value = model.roomNum;
            parameters[12].Value = model.department;
            parameters[13].Value = model.username;
            parameters[14].Value = model.addId;
            parameters[15].Value = model.addtime;
            parameters[16].Value = model.updateId;
            parameters[17].Value = System.DateTime.Now;
            parameters[18].Value = model.description;
            parameters[19].Value = model.flag;
            parameters[20].Value = model.buyTime;
            parameters[21].Value = model.giveTime;
            parameters[22].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Ejemplo n.º 51
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DLL.Model.admin model)
 {
     Boolean flag = dal.Update(model);
     if (flag == true)
     {
         loginfo.adminname = System.Web.HttpContext.Current.Session["Username"].ToString();
         loginfo.action = "修改";
         loginfo.objectname = "管理员:" + model.username + "的信息";
         new DLL.BLL.loginfo().Add(loginfo);
     }
     return flag;
 }
Ejemplo n.º 52
0
 public int updateNombreEmpresa(DLL.Empresa e)
 {
     string sql = "UPDATE empresas SET nombreEmpresa = '" + e.Nombre + "' WHERE idEmpresa = " + e.IdEmpresa + ";";
     return b.executecommand(sql);
 }
Ejemplo n.º 53
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DLL obj)
 {
     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Ejemplo n.º 54
0
 public int insertInsumo(DLL.Insumo i)
 {
     string sql = "INSERT INTO insumos VALUES (" + i.IdInsumos + "," + i.NroGuia + ",'" + i.FechaGuia + "'," + i.Cantidad + ",'" + i.FechaRealizacion + "'," + i.IdArticulo + ", " + i.IdItem + "," + i.IdLocal + "); ";
     return b.executecommand(sql);
 }
Ejemplo n.º 55
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DLL.Model.repair model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update repair set ");
            strSql.Append("computerId=@computerId,");
            strSql.Append("defineId=@defineId,");
            strSql.Append("adminId=@adminId,");
            strSql.Append("adminname=@adminname,");
            strSql.Append("ftype=@ftype,");
            strSql.Append("result=@result,");
            strSql.Append("addTime=@addTime");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@computerId", SqlDbType.Int,4),
                    new SqlParameter("@defineId", SqlDbType.VarChar,500),
                    new SqlParameter("@adminId", SqlDbType.Int,4),
                    new SqlParameter("@adminname", SqlDbType.VarChar,500),
                    new SqlParameter("@ftype", SqlDbType.VarChar,500),
                    new SqlParameter("@result", SqlDbType.VarChar),
                    new SqlParameter("@addTime", SqlDbType.DateTime),
                    new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = model.computerId;
            parameters[1].Value = model.defineId;
            parameters[2].Value = model.adminId;
            parameters[3].Value = model.adminname;
            parameters[4].Value = model.ftype;
            parameters[5].Value = model.result;
            parameters[6].Value = model.addTime;
            parameters[7].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }