예제 #1
0
        private void ExecuteDataFunction(TestToolSettings testToolSettings)
        {
            testToolSettings.Document.Transactions.ExecuteTransaction(delegate
            {
                InputParameter categoryColumns, dataColumns, calculateKind;
                OutputParameter returnMessage, resultAll;

                bool includeFilter = string.Equals("filtered", settings.DataRange, StringComparison.OrdinalIgnoreCase);

                DataFunction function = testToolSettings.Document.Data.DataFunctions.AddNew("RTest", GetFunctionDefinition(out categoryColumns, out dataColumns, out calculateKind, out returnMessage, out resultAll));

                string categoryColumnsExp = string.Join(",",
                                                        settings.CategoryColumns.Select(c => $"[{settings.DataTable}].[{c}]").ToArray());
                function.Inputs.SetInput(categoryColumns, categoryColumnsExp, includeFilter);

                string dataColumnsExp = string.Join(",",
                                                    settings.DataColumns.Select(c => $"[{settings.DataTable}].[{c}]").ToArray());
                function.Inputs.SetInput(dataColumns, dataColumnsExp, includeFilter);

                function.Inputs.SetInput(calculateKind, $@"""{settings.CalculatedKind}""");

                function.Outputs.SetTableOutput(returnMessage, "returnMessage");
                function.Outputs.SetTableOutput(resultAll, "resultAll");

                function.Execute();
            });
        }
예제 #2
0
    public void FillDataddl()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Country");

        ddlcountry.DataSource     = ds;
        ddlcountry.DataTextField  = "country";
        ddlcountry.DataValueField = "id";
        ddlcountry.DataBind();

        ddlcountry.Items.Insert(0, new ListItem("Select Country*", "0"));
        ddlstate.Items.Insert(0, new ListItem("Select State*", "0"));
        ddlcity.Items.Insert(0, new ListItem("Select City*", "0"));

        FillGender();
        ddlgender.Items.Insert(0, new ListItem("Select Gender*", "0"));
        FillMotherTongue();
        ddlmothertongue.Items.Insert(0, new ListItem("Select MotherTongue*", "0"));
        FillReligion();
        ddlreligion.Items.Insert(0, new ListItem("Select Religion*", "0"));
        FillProfileFor();
        ddlprofilefor.Items.Insert(0, new ListItem("Select ProfileFor*", "0"));
    }
예제 #3
0
        public JsonResult UpdateInfo(string phone, string address, int marry, string ipphone, string noteContact)
        {
            try
            {
                NI10_Employee   employee     = (Session["EmployeeLogin"] != null) ? (NI10_Employee)Session["EmployeeLogin"] : new NI10_Employee();
                PutDataResponse dataResponse = DataFunction.PutDataToService(serviceUrl, "Request/GetData", "",
                                                                             new List <string>()
                {
                    "@EmployeeCode", employee.EmployeeCode,
                    "@PhoneNumber", phone,
                    "@Address", address,
                    "@Marry", marry.ToString(),
                    "@IPphone", ipphone,
                    "@NoteContact", noteContact
                },
                                                                             "[dbo].[NI10_Employee_UpdateInfo]");

                if (dataResponse.StatusCode == "DONE")
                {
                    return(Json("1", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json("0", JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json("0", JsonRequestBehavior.AllowGet));
            }
        }
예제 #4
0
 public void RunOverAllData(DataFunction func)
 {
     for (int i = 0; i < _dataList.Count; ++i)
     {
         _dataList[i].Data = func(_dataList[i].Data, _dataList[i].Time, i);
     }
 }
예제 #5
0
        public int Accept(DataFunction func)
        {
            FuncData.Clear();
            FuncData.AddRange(func.Data);

            return(ErrorCode);
        }
예제 #6
0
        public void T10_NACK()
        {
            var device = TC.CentralDevice;

            TC.PeripheralDevice.ErrorCode = (int)TestErrorCode.INVALID_OPERATION;
            var data = new List <byte>()
            {
                1, 2, 3, 4
            };
            var func = new DataFunction(data);

            Assert.ThrowsException <FunctionNotAcknowledgedException>(() => device.Execute(func));

            try
            {
                device.Execute(func);
            }
            catch (FunctionNotAcknowledgedException e)
            {
                Console.WriteLine($"NACK Received: {device.GetErrorString(e.ErrorCode)}");
            }

            TC.PeripheralDevice.ErrorCode = 0;
            device.Execute(func);
        }
예제 #7
0
        public void Convert_InvalidConvert_ThrowException()
        {
            // arrange
            var source = NdArray <int> .Scalar(HostDevice.Instance, 2);

            // action
            var result = DataFunction <string> .Convert(source);
        }
예제 #8
0
        // GET: Detail
        public ActionResult Detail(string id)
        {
            string serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
            List <TasklistModel> dataResponse = DataFunction.GetCustomObjectListFromService <TasklistModel>
                                                (
                serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@SSID", "", "@ACTION", "", "@OBJECTID", "", "@USERID", SEmployee.EmployeeCode, "@StatusType", "", "@TaskType", "", "@TaskID", id
            }, "[dbo].[NI09_TaskList_Items_GetlList]"
                                                );

            List <ListTasklistStatusModel> dataResponse2 = DataFunction.GetCustomObjectListFromService <ListTasklistStatusModel>
                                                           (
                serviceUrl, "Request/GetData", "", new List <string>()
            {
            }, "[dbo].[NI09_TaskList_GetListStatus]"
                                                           );

            ViewBag.ListStatus = dataResponse2;
            TasklistModel model            = new TasklistModel();
            TasklistModel taskParentDetail = new TasklistModel();

            ViewBag.taskParentDetail = taskParentDetail;
            if (dataResponse.Count > 0)
            {
                model = dataResponse.FirstOrDefault();
                model.OptionListDB = new SqlSelectListDao().GetSelectLists("NI09_TaskList_OptionList_GetList");


                model.OptionListView = (from a in model.OptionStringItemList
                                        join b in model.OptionListDB on a.KeyName equals b.Code
                                        select new OptionListModel
                {
                    Code = a.KeyName,
                    Name = b.Name,
                    Val = a.KeyVal
                }).ToList();
                if (model.ParentID > 0)
                {
                    List <TasklistModel> dataResponse3 = DataFunction.GetCustomObjectListFromService <TasklistModel>
                                                         (
                        serviceUrl, "Request/GetData", "", new List <string>()
                    {
                        "@SSID", "", "@ACTION", "", "@OBJECTID", "", "@USERID", "", "@StatusType", "", "@TaskType", "", "@TaskID", model.ParentID.ToString()
                    }, "[dbo].[NI09_TaskList_Items_GetlList]"
                                                         );
                    if (dataResponse3.Count > 0)
                    {
                        taskParentDetail         = dataResponse3.FirstOrDefault();
                        ViewBag.taskParentDetail = taskParentDetail;
                    }
                }
            }
            // model.TaskTypeList = new SqlSelectListDao().GetSelectLists("spSelectList_NI09_TaskList_TaskTypeList");
            return(View(model));
        }
예제 #9
0
        public string ChangeIsCheckCheckList(string TaskID, string CheckList)
        {
            string          serviceUrl    = ConfigurationManager.AppSettings["ServiceUrl"];
            PutDataResponse updateIsCheck = DataFunction.PutDataToService(serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@TaskID", TaskID, "@StatusType", "", "@CheckList", CheckList, "@IsFollow", ""
            }, "[dbo].[NI09_TaskList_Items_Update]");

            return(JsonConvert.SerializeObject(updateIsCheck));
        }
예제 #10
0
        public JsonResult Follow(string TaskID, string IsFollow)
        {
            string          serviceUrl   = ConfigurationManager.AppSettings["ServiceUrl"];
            PutDataResponse updateStatus = DataFunction.PutDataToService(serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@IsFollow", IsFollow, "@TaskID", TaskID
            }, "[dbo].[NI09_TaskList_Items_Update]");

            return(Json(updateStatus, JsonRequestBehavior.AllowGet));
        }
예제 #11
0
 public void CopyToDB(DataTable dt, string tableName, bool doCreateTable = true)
 {
     if (doCreateTable)
     {
         ExecuteNonQuery("CREATE TABLE " + tableName + "( " + DataFunction.GetTableDef(dt) + ")");
     }
     foreach (DataRow dr in dt.Rows)
     {
         Insert(tableName, dr);
     }
 }
예제 #12
0
파일: Grid.cs 프로젝트: vanish87/UnityFluid
 public override void ForEachData(DataFunction func)
 {
     for (var i = 0; i < this.DataSize.x; ++i)
     {
         for (var j = 0; j < this.DataSize.y; ++j)
         {
             var dataIndex = this.AbsoluteDataIndex(i, j);
             func(ref this.data[dataIndex], i, j);
         }
     }
 }
예제 #13
0
        public ActionResult MenuInfo()
        {
            string           serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
            NI10_Employee    employee   = (Session["EmployeeLogin"] != null) ? (NI10_Employee)Session["EmployeeLogin"] : new NI10_Employee();
            List <NI10_Menu> menus      = DataFunction.GetCustomObjectListFromService <NI10_Menu>(serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@employeeCode", employee.EmployeeCode
            }, "[dbo].[NI10_Menu_GetByEmployeeCode]");

            return(View(menus));
        }
예제 #14
0
        public void Convert()
        {
            // arrange
            var source = NdArray <int> .Scalar(HostDevice.Instance, 2);

            // action
            var result = DataFunction <double> .Convert(source).Value;

            // assert
            Assert.IsInstanceOfType(result, typeof(double));
            Assert.AreEqual(2.0, result);
        }
예제 #15
0
    public void FillGender()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Gender");

        ddlgender.DataSource     = ds;
        ddlgender.DataTextField  = "gender";
        ddlgender.DataValueField = "id";
        ddlgender.DataBind();
    }
예제 #16
0
    public void FillMotherTongue()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from MotherTongue");

        ddlmothertongue.DataSource     = ds;
        ddlmothertongue.DataTextField  = "mothertongue";
        ddlmothertongue.DataValueField = "id";
        ddlmothertongue.DataBind();
    }
예제 #17
0
    public void FillProfileFor()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from ProfileFor");

        ddlprofilefor.DataSource     = ds;
        ddlprofilefor.DataTextField  = "profilefor";
        ddlprofilefor.DataValueField = "id";
        ddlprofilefor.DataBind();
    }
예제 #18
0
    public void FillReligion()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Religion");

        ddlreligion.DataSource     = ds;
        ddlreligion.DataTextField  = "religion";
        ddlreligion.DataValueField = "id";
        ddlreligion.DataBind();
    }
예제 #19
0
        // GET: AddUpdate
        public ActionResult AddUpdate(string id)
        {
            TasklistModel model      = new TasklistModel();
            string        serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];

            if (!String.IsNullOrEmpty(id))
            {
                List <TasklistModel> content = DataFunction.GetCustomObjectListFromService <TasklistModel>
                                               (
                    serviceUrl, "Request/GetData", "", new List <string>()
                {
                    "@SSID", "", "@ACTION", "", "@OBJECTID", "", "@USERID", SEmployee.EmployeeCode, "@StatusType", "", "@TaskType", "", "@TaskID", id
                }, "[dbo].[NI09_TaskList_Items_GetlList]"
                                               );
                model = content.FirstOrDefault();
                model.OptionListDB = new SqlSelectListDao().GetSelectLists("NI09_TaskList_OptionList_GetList");


                model.OptionListView = (from a in model.OptionStringItemList
                                        join b in model.OptionListDB on a.KeyName equals b.Code
                                        select new OptionListModel
                {
                    Code = a.KeyName,
                    Name = b.Name,
                    Val = a.KeyVal
                }).ToList();
            }
            else
            {
                model.OptionListDB   = new SqlSelectListDao().GetSelectLists("NI09_TaskList_OptionList_GetList");
                model.OptionListView = (from a in model.OptionListDB
                                        select new OptionListModel
                {
                    Code = a.Code,
                    Name = a.Name,
                    Val = false
                }).ToList();
            }
            model.TaskTypeList           = new SqlSelectListDao().GetSelectLists("spSelectList_NI09_TaskList_TaskTypeList");
            model.ObjectInChargeTypeList = new SqlSelectListDao().GetSelectLists("spSelectList_NI09_TaskList_ObjectInChargeTypeList");
            model.PriorityList           = new SqlSelectListDao().GetSelectLists("spSelectList_NI09_TaskList_PriorityLevel");
            List <ListTasklistStatusModel> dataResponse2 = DataFunction.GetCustomObjectListFromService <ListTasklistStatusModel>
                                                           (
                serviceUrl, "Request/GetData", "", new List <string>()
            {
            }, "[dbo].[NI09_TaskList_GetListStatus]"
                                                           );

            ViewBag.ListStatus = dataResponse2;

            return(View(model));
        }
    public void FillMarital()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from MaritalStatus");

        ddlmaritalstatus.DataSource     = ds;
        ddlmaritalstatus.DataTextField  = "maritalstatus";
        ddlmaritalstatus.DataValueField = "id";
        ddlmaritalstatus.DataBind();
        ddlmaritalstatus.Items.Insert(0, new ListItem("Marital Status*", "0"));
    }
예제 #21
0
        public JsonResult LoadObjectInChargeTypeByUser(string lstItemCode = "", string ItemType = "")
        {
            string serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
            List <BussinessObjects.SelectList> dataList = DataFunction.GetCustomObjectListFromService <BussinessObjects.SelectList>
                                                          (
                serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@lstItemCode", lstItemCode, "ItemType", ItemType
            }, "[dbo].[NI09_TaskList_ObjectInCharge_List_GetByListItemCode]"
                                                          );

            return(Json(dataList, JsonRequestBehavior.AllowGet));
        }
예제 #22
0
파일: Grid.cs 프로젝트: vanish87/UnityFluid
        public void ForEachvData(DataFunction func)
        {
            var type = DataType.V;

            for (var i = 0; i < this.dataSize[type].x; ++i)
            {
                for (var j = 0; j < this.dataSize[type].y; ++j)
                {
                    var dataIndex = this.AbsoluteIndex(type, i, j);
                    func(ref this.data[type][dataIndex], i, j);
                }
            }
        }
예제 #23
0
        public JsonResult SearchTaskParent(string TaskTitle = "")
        {
            string serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
            List <BussinessObjects.SelectList> dataList = DataFunction.GetCustomObjectListFromService <BussinessObjects.SelectList>
                                                          (
                serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@TaskTitle", TaskTitle
            }, "[dbo].[NI09_TaskList_Items_Search]"
                                                          );

            return(Json(dataList, JsonRequestBehavior.AllowGet));
        }
예제 #24
0
        public JsonResult AddTaskType(string ItemName)
        {
            string serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
            List <BussinessObjects.SelectList> dataList = DataFunction.GetCustomObjectListFromService <BussinessObjects.SelectList>
                                                          (
                serviceUrl, "Request/GetData", "", new List <string>()
            {
                "@ItemName", ItemName
            }, "[dbo].[NI09_TaskList_ListTaskType_Save]"
                                                          );

            return(Json(dataList, JsonRequestBehavior.AllowGet));
        }
예제 #25
0
            /// <summary>
            /// Stops receiving thread and receives data
            /// </summary>
            /// <param name="timeout">Receive timeout ( -1 = infinite )</param>
            public void ForceReceive(int timeout = -1)
            {
                DataFunction functionBackup = dataReceivedFunction;

                dataReceivedFunction = null;

                suspendReceivingThread = true;

                Receive(true, false, timeout);
                dataReceivedFunction = functionBackup;

                suspendReceivingThread = false;
            }
    public void FillHobbies()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Hobbies");

        ddldrinking.DataSource     = ds;
        ddldrinking.DataTextField  = "hobbies";
        ddldrinking.DataValueField = "id";
        ddldrinking.DataBind();
        ddldrinking.Items.Insert(0, new ListItem("Drinking / Smoking*", "0"));
    }
    public void FillHeight()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Height");

        ddlheight.DataSource     = ds;
        ddlheight.DataTextField  = "height";
        ddlheight.DataValueField = "id";
        ddlheight.DataBind();
        ddlheight.Items.Insert(0, new ListItem("Height*", "0"));
    }
    public void FillFamily()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from FamilyStatus");

        ddlfamilystatus.DataSource     = ds;
        ddlfamilystatus.DataTextField  = "familystatus";
        ddlfamilystatus.DataValueField = "id";
        ddlfamilystatus.DataBind();
        ddlfamilystatus.Items.Insert(0, new ListItem("Family Status*", "0"));
    }
    public void FillEmployeein()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from EmployeeIn");

        ddlemployee.DataSource     = ds;
        ddlemployee.DataTextField  = "employeein";
        ddlemployee.DataValueField = "id";
        ddlemployee.DataBind();
        ddlemployee.Items.Insert(0, new ListItem("Employee In*", "0"));
    }
    public void FilllLiving()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from LivingStatus");

        ddlfamily.DataSource     = ds;
        ddlfamily.DataTextField  = "livingstatus";
        ddlfamily.DataValueField = "id";
        ddlfamily.DataBind();
        ddlfamily.Items.Insert(0, new ListItem("You live with youe family?", "0"));
    }