public void AsDynamicXml_WhenGivenValidXml_ShouldReturnDynamicXml()
        {
            var c = new GridRowCollection("<items><item id=\"2\"><member nodeName=\"Member\" nodeType=\"1036\">1312</member></item><item id=\"3\"><member nodeName=\"Member\" nodeType=\"1036\">1189</member></item><item id=\"4\"><member nodeName=\"Member\" nodeType=\"1036\">1370</member></item></items>");
            var x = c.AsDynamicXml();

            Assert.IsInstanceOfType(x, typeof(DynamicXml));
        }
Beispiel #2
0
        public void AsDynamicXml_WhenGivenValidGridRowCollection_ShouldReturnDynamicXml()
        {
            var c = new GridRowCollection();
            var x = c.AsDynamicXml();

            Assert.IsInstanceOfType(x, typeof(DynamicXml));
        }
        public void AsDynamicXml_WhenGivenValidGridRowCollection_ShouldReturnDynamicXml()
        {
            var c = new GridRowCollection();
            var x = c.AsDynamicXml();

            Assert.IsInstanceOfType(x, typeof(DynamicXml));
        }
Beispiel #4
0
        public void AsDynamicXml_WhenGivenValidXml_ShouldReturnDynamicXml()
        {
            var c = new GridRowCollection("<items><item id=\"2\"><member nodeName=\"Member\" nodeType=\"1036\">1312</member></item><item id=\"3\"><member nodeName=\"Member\" nodeType=\"1036\">1189</member></item><item id=\"4\"><member nodeName=\"Member\" nodeType=\"1036\">1370</member></item></items>");
            var x = c.AsDynamicXml();

            Assert.IsInstanceOfType(x, typeof(DynamicXml));
        }
Beispiel #5
0
        public void New_WhenGivenValidXml_ShouldCreateGridRowCollection()
        {
            var xml = "<items><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">Manual</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6306?_download=true&amp;_ts=13ab17f5a82</documentUrl></item><item id=\"1\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">FDV dokumentasjon</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6305?_download=true&amp;_ts=13ab17f1573</documentUrl></item></items>";

            var c = new GridRowCollection(xml);

            Assert.IsNotNull(c);
        }
Beispiel #6
0
        public void New_WhenGivenValidXml2_ShouldCreateGridRowCollection()
        {
            var xml = "<items><item id=\"1\" sortOrder=\"1\"><featureHeading nodeName=\"Feature Heading\" nodeType=\"-88\">Build your no claims discount fast with our Student Bonus Accelerator</featureHeading><featureDescription nodeName=\"Feature Description\" nodeType=\"1038\">If you don’t make a claim, you could build 2 years no claims discount in just 18 months. Even if you make a windscreen claim or have a claim where all costs are recovered, it won’t affect this offer.This exclusive offer is only available to students. If you’d like information on what happens if your occupation changes or you transfer your policy please see our terms and conditions.</featureDescription><featureAccordion nodeName=\"Feature Accordion (show/hide text)\" nodeType=\"1034\" /></item><item id=\"3\" sortOrder=\"2\"><featureHeading nodeName=\"Feature Heading\" nodeType=\"-88\">We’ll get you back on the road quicker</featureHeading><featureDescription nodeName=\"Feature Description\" nodeType=\"1038\">We settle quickly. One call to our team will help you with everything for your claim. Our mobile repair service, where possible, comes to you to save you time.</featureDescription><featureAccordion nodeName=\"Feature Accordion (show/hide text)\" nodeType=\"1034\" /></item><item id=\"2\" sortOrder=\"3\"><featureHeading nodeName=\"Feature Heading\" nodeType=\"-88\">24 hour windscreen and glass cover with our comprehensive policies</featureHeading><featureDescription nodeName=\"Feature Description\" nodeType=\"1038\">When you take out a comprehensive policy, you can rest assured that your windscreen and other glass is protected.This is a new para.</featureDescription><featureAccordion nodeName=\"Feature Accordion (show/hide text)\" nodeType=\"1034\" /></item></items>";

            var c = new GridRowCollection(xml);

            Assert.IsNotNull(c);
        }
        public void GridRowCollection_Constructor_WhenArgumentIsCorrect_DoesNotThrow()
        {
            Grid <string> grid = new Grid <string>(GRID_WIDTH, GRID_HEIGHT, "My taylor is rich!");

            Assert.DoesNotThrow(() =>
            {
                GridRowCollection <string> grc = new GridRowCollection <string>(grid);
            });
        }
        public void Insert_WhenGivenGridRowsWithNonUniqueIds_ShouldThrowException()
        {
            var c = new GridRowCollection();
            var r1 = new GridRow(0) { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } };
            var r2 = new GridRow(0) { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } };

            c.Insert(0, r1);
            c.Insert(0, r2);
        }
        public void GridRowCollection_Constructor_WhenGridIsNull_ThrowArgumentNullException()
        {
            Grid <string> grid = null;

            Assert.Throws <ArgumentNullException>(() =>
            {
                GridRowCollection <string> grc = new GridRowCollection <string>(grid);
            });
        }
        public void GridRowCollection_Index_WhenArgumentOutOfRange_ThrowIndexOutOfRangeException(int col)
        {
            Grid <char> grid = new Grid <char>(GRID_WIDTH, GRID_HEIGHT);

            GridRowCollection <char> grc = new GridRowCollection <char>(grid);

            Assert.Throws <IndexOutOfRangeException>(() =>
            {
                GridRow <char> row = grc[col];
            });
        }
        public void GridRowCollection_Index_WhenArgumentIsCorrect_DoesNotThrow(int col)
        {
            Grid <char> grid = new Grid <char>(GRID_WIDTH, GRID_HEIGHT);

            GridRowCollection <char> grc = new GridRowCollection <char>(grid);

            Assert.DoesNotThrow(() =>
            {
                GridRow <char> row = grc[col];
            });
        }
        public void GridRowCollection_Rows_Count_Equals_Grid_Height()
        {
            Grid <ushort> grid = new Grid <ushort>(GRID_WIDTH, GRID_HEIGHT);

            GridRowCollection <ushort> grc = new GridRowCollection <ushort>(grid);

            int rowCount   = grc.Count();
            int gridHeight = grid.Height;

            Assert.AreEqual(rowCount, gridHeight);
        }
        public void Insert_WhenGivenGridRowsWithUniqueIds_ShouldAddGridRow()
        {
            var c = new GridRowCollection();
            var r1 = new GridRow() { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } };
            var r2 = new GridRow() { new GridCell() { Alias = "test", DataType = -88, Name = "Test", Value = "1234" } };

            c.Insert(0, r1);
            c.Insert(0, r2);

            Assert.IsTrue(c.Any(x => x.Id == r1.Id));
            Assert.IsTrue(c.Any(x => x.Id == r2.Id));
        }
Beispiel #14
0
        public void ToString_WhenGivenValidXml_ShouldReturnSameXml()
        {
            var xml1 = "<items><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">Manual</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6306?_download=true&amp;_ts=13ab17f5a82</documentUrl></item><item id=\"1\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">FDV dokumentasjon</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6305?_download=true&amp;_ts=13ab17f1573</documentUrl></item></items>";
            var xml2 = "<items><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">Installasjonsmanual</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6296?_download=true&amp;_ts=13ab176bd6a</documentUrl></item><item id=\"1\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">FDV dokumentasjon</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6295?_download=true&amp;_ts=13ab176537b</documentUrl></item></items>";

            var c1 = new GridRowCollection(xml1);
            var c2 = new GridRowCollection(xml2);

            var s1 = c1.ToString();
            var s2 = c2.ToString();

            Assert.AreEqual(s1, xml1);
            Assert.AreEqual(s2, xml2);
        }
        public void GridRowCollection_EnumerateRows_DoesNotThrow()
        {
            Grid <string> grid = new Grid <string>(GRID_WIDTH, GRID_HEIGHT, "Hello world!");

            GridRowCollection <string> grc = new GridRowCollection <string>(grid);

            Assert.DoesNotThrow(() =>
            {
                foreach (GridRow <string> gridRow in grc)
                {
                    continue;
                }
            });
        }
Beispiel #16
0
        public virtual void StartDragDrop()
        {
            GridRowCollection rows = new GridRowCollection();

            foreach (GridRow row in RowsAndChildren)
            {
                if (row.Selected && IsDraggableRow(row))
                {
                    rows.Add(row);
                }
            }
            if (rows.Count > 0)
            {
                DoDragDrop(rows, DragDropEffects.Move);
            }
        }
Beispiel #17
0
        protected DragDropCommand(IMainWindow mainWindow, VirtualTreeNode targetNode, IDataObject dragData)
        {
            Util.ThrowIfParameterNull(mainWindow, "mainWindow");
            Util.ThrowIfParameterNull(dragData, "dragData");
            _mainWindow = mainWindow;
            _targetNode = targetNode;

            if (dragData.GetDataPresent(typeof(GridRowCollection)))
            {
                _draggedGridRows = (GridRowCollection)dragData.GetData(typeof(GridRowCollection));
            }
            else if (dragData.GetDataPresent(typeof(VirtualTreeNode[])))
            {
                _draggedNodes = new ReadOnlyCollection <VirtualTreeNode>(new List <VirtualTreeNode>((VirtualTreeNode[])dragData.GetData(typeof(VirtualTreeNode[]))));
            }
        }
        /// <summary>
        /// Attempts to convert the value specified into a useable value on the front-end
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>The conversion attempt.</returns>
        public Attempt <object> ConvertPropertyValue(object value)
        {
            if (value != null && value.ToString().Length > 0)
            {
                try
                {
                    var c = new GridRowCollection(value.ToString()).OrderBy(x => x.SortOrder).ToList();

                    return(new Attempt <object>(true, (GridRowCollection)c));
                }
                catch
                {
                    return(Attempt <object> .False);
                }
            }

            return(Attempt <object> .False);
        }
        /// <summary>
        /// Attempts to convert the value specified into a useable value on the front-end
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>The conversion attempt.</returns>
        public Attempt<object> ConvertPropertyValue(object value)
        {
            if (value != null && value.ToString().Length > 0)
            {
                try
                {
                    var c = new GridRowCollection(value.ToString()).OrderBy(x => x.SortOrder).ToList();

                    return new Attempt<object>(true, (GridRowCollection)c);
                }
                catch
                {
                    return Attempt<object>.False;
                }
            }

            return Attempt<object>.False;
        }
Beispiel #20
0
        public void Insert_WhenGivenGridRowsWithNonUniqueIds_ShouldThrowException()
        {
            var c  = new GridRowCollection();
            var r1 = new GridRow(0)
            {
                new GridCell()
                {
                    Alias = "test", DataType = -88, Name = "Test", Value = "1234"
                }
            };
            var r2 = new GridRow(0)
            {
                new GridCell()
                {
                    Alias = "test", DataType = -88, Name = "Test", Value = "1234"
                }
            };

            c.Insert(0, r1);
            c.Insert(0, r2);
        }
Beispiel #21
0
        /// <summary>
        /// Initializes the model binder.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns>True if initialization was successful. Otherwise false.</returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                instance = new DynamicXml(PropertyData);

                return(true);
            }

            try
            {
                var c = new GridRowCollection(PropertyData).OrderBy(x => x.SortOrder).ToList();

                instance = (GridRowCollection)c;
            }
            catch
            {
                instance = new GridRowCollection();

                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Initializes the model binder.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns>True if initialization was successful. Otherwise false.</returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                instance = new DynamicXml(PropertyData);

                return true;
            }

            try
            {
                var c = new GridRowCollection(PropertyData).OrderBy(x => x.SortOrder).ToList();

                instance = (GridRowCollection)c;
            }
            catch
            {
                instance = new GridRowCollection();

                return false;
            }

            return true;
        }
Beispiel #23
0
        public void Insert_WhenGivenGridRowsWithUniqueIds_ShouldAddGridRow()
        {
            var c  = new GridRowCollection();
            var r1 = new GridRow()
            {
                new GridCell()
                {
                    Alias = "test", DataType = -88, Name = "Test", Value = "1234"
                }
            };
            var r2 = new GridRow()
            {
                new GridCell()
                {
                    Alias = "test", DataType = -88, Name = "Test", Value = "1234"
                }
            };

            c.Insert(0, r1);
            c.Insert(0, r2);

            Assert.IsTrue(c.Any(x => x.Id == r1.Id));
            Assert.IsTrue(c.Any(x => x.Id == r2.Id));
        }
Beispiel #24
0
 public GridTable()
 {
     this.cols = new GridColumnCollection(this);
     this.rows = new GridRowCollection(this);
 }
Beispiel #25
0
        ///保存
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            GridRowCollection GridRow = GridTest.Rows;

            if (barcodeservice.CheckBarCode(tbxbarcode1.Text.Trim()))//条码号存在
            {
                MessageBoxShow(string.Format("此条码号[{0}]已在本系统内生成,请更改条码号!", this.tbxbarcode1.Text.Trim()));
                return;
            }
            double?memberid = null;

            if (tbxmemberID.Text != string.Empty)
            {
                memberid = Convert.ToDouble(tbxmemberID.Text);
            }

            ///获取系统时间时间
            DateTime?date = loginservice.GetServerTime();
            DateTime?datebirthday = null;
            int      year = 0, month = 0, day = 0, hour = 0;//年月日时
            double   customerid;
            //验证会员信息
            string msg = SaveCheck(date, out datebirthday, out year, out month, out day, out hour, out customerid);

            if (msg != string.Empty)
            {
                MessageBoxShow(msg); return;
            }

            List <Dicttestitem> grouptestList = new List <Dicttestitem>(); //订单中组合集合
            List <Dicttestitem> productList   = new List <Dicttestitem>(); //订单中套餐集合
            ///实验室分点
            double labid = Convert.ToDouble(DropDictLab.SelectedValue);
            List <Dicttestgroupdetail> TestGroupDetailList = loginservice.GetLoginDicttestgroupdetail();//组合项目字典
            //获取集合
            List <OrderRegister> _gridtestList = GetGridTest(true);

            #region >>>> zhouy 获取订单中 组合,套餐

            for (int i = 0; i < _gridtestList.Count; i++)
            {
                OrderRegister item = _gridtestList[i];
                //判断性别是否符合
                string str = registerserver.checkSex(item.Id, DropSex.SelectedValue);
                if (str != string.Empty)
                {
                    MessageBoxShow(str); return;
                }

                Dicttestitem _groupitem;
                ///添加组合|项目
                _groupitem                   = new Dicttestitem();
                _groupitem                   = registerserver.SelectsTestItemListById(item.Id);
                _groupitem.IsActive          = item.Isactive; //是否停止测试
                _groupitem.Isadd             = item.Isadd;    ///是否追加
                _groupitem.Billed            = item.Billed;
                _groupitem.Sendbilled        = item.Sendbilled;
                _groupitem.Adduserid         = item.Adduserid;///追加人ID
                _groupitem.Sendoutcustomerid = item.Sendoutcustomerid;
                _groupitem.Tubegroup         = item.Tubegroup;
                _groupitem.Barcode           = item.Barcode;
                if (item.IsProduct)///套餐 去套餐ID和套餐名
                {
                    _groupitem.Productid   = item.Productid;
                    _groupitem.Productname = item.Productname;///套餐名
                    ///---------------------添加套餐-------------------------------------
                    ///不包含此套餐才添加
                    if (productList.Where(c => c.Dicttestitemid == item.Productid).Count() <= 0)
                    {
                        Dicttestitem _product = registerserver.SelectsTestItemListById(item.Productid);
                        productList.Add(_product);
                    }
                    ///----------------------end添加套餐-------------------------------------
                }
                else
                {
                    Dicttestitem _product = registerserver.SelectsTestItemListById(item.Id);
                    productList.Add(_product);
                }

                grouptestList.Add(_groupitem);
            }

            #endregion

            #region >>>> zhouy 会员信息

            Dictmember member = new Dictmember();
            member.Realname = tbxName.Text;
            member.Idnumber = tbxIDNumber.Text;
            //检查会员
            string errstr = registerserver.checkmember(memberid, ref member);
            if (errstr != string.Empty)
            {
                MessageBoxShow(errstr); return;
            }

            member.Nickname = tbxName.Text;
            member.Sex      = DropSex.SelectedValue;
            member.Birthday = datebirthday;
            member.Addres   = tbxAddres.Text;
            member.Mobile   = tbxMobile.Text;
            member.Email    = tbxEMail.Text;
            member.Islock   = "F";///是否锁定

            #endregion

            #region >>>> zhouy insert Orders

            Orders _orders = new Orders();
            _orders.Ordernum       = tbxOrderNum.Text;                                           ///体检流水号
            _orders.Remarks        = tbxRemark.Text;                                             ///备注
            _orders.Dictmemberid   = member.Dictmemberid;                                        ///会员ID
            _orders.Dictcustomerid = customerid;                                                 ///所属客户ID
            _orders.Realname       = member.Nickname;
            _orders.Sex            = member.Sex;                                                 ///性别 对应INITBASIC表
            _orders.Caculatedage   = AgeToHour(year, month, day, hour);                          ///计算后的年龄(小时为单位)
            _orders.Age            = string.Format("{0}岁{1}月{2}日{3}时", year, month, day, hour);; ///年龄字符串拼接 年月日时
            _orders.Enterby        = Userinfo.userName;                                          ///录入人
            _orders.Ordertestlst   = tbxItemTest.Text;                                           ///项目清单(冗余字段)
            _orders.Dictlabid      = labid;                                                      ///实验室分点
            //_orders.Ordersource = radlCustomerType.SelectedValue;
            _orders.Ordersource = "1";                                                           //默认单位
            _orders.Ismarried   = radlIsMarried.SelectedValue;                                   ///婚否
            _orders.Section     = tbxSection.Text;                                               ///部门
            _orders.Createdate  = date;

            //_orders.Provincename = dpProvince.SelectedValue == "-1" ? "" : dpProvince.SelectedText;
            //_orders.Cityname = dpCity.SelectedValue == "-1" ? "" : dpCity.SelectedText;
            //_orders.Countyname = dpCounty.SelectedValue == "-1" ? "" : dpCounty.SelectedText;
            #endregion

            string error = "";
            bool   b     = registerserver.insertUpdateOrders("体检登记", "", true, productList, grouptestList, member, _orders, "", ref error);
            if (b)
            {
                clearData(true);
            }
            else
            {
                MessageBoxShow("保存失败:" + error);
            }
        }
Beispiel #26
0
        ///保存
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            GridRowCollection GridRow = GridTest.Rows;

            double?memberid = null;

            if (tbxmemberID.Text != string.Empty)
            {
                memberid = Convert.ToDouble(tbxmemberID.Text);
            }

            ///获取系统时间时间
            DateTime?date = loginservice.GetServerTime();
            DateTime?datebirthday = null;
            int      year = 0, month = 0, day = 0, hour = 0;//年月日时
            double   customerid;
            //验证
            string msg = SaveCheck(date, out datebirthday, out year, out month, out day, out hour, out customerid);

            if (msg != string.Empty)
            {
                MessageBoxShow(msg); return;
            }

            List <Dicttestitem> grouptestList = new List <Dicttestitem>(); //订单中组合集合
            List <Dicttestitem> productList   = new List <Dicttestitem>(); //订单中套餐集合
            ///实验室分点
            double labid = Convert.ToDouble(tbxDictLab.Label);
            List <Dicttestgroupdetail> TestGroupDetailList = loginservice.GetLoginDicttestgroupdetail();//组合项目字典
            //获取集合
            List <OrderRegister> _gridtestList = GetGridTest(true);

            //已接收的条码号
            string ReceivedBarcode = string.Empty;

            #region >>>> zhouy 获取订单中 组合,套餐

            for (int i = 0; i < _gridtestList.Count; i++)
            {
                OrderRegister item = _gridtestList[i];
                if (item.IsProduct)///套餐 取套餐ID和套餐名
                {
                    ///---------------------添加套餐-------------------------------------
                    ///不包含此套餐才添加
                    if (productList.Where(c => c.Dicttestitemid == item.Productid).Count() <= 0)
                    {
                        Dicttestitem _product = registerserver.SelectsTestItemListById(item.Productid);
                        productList.Add(_product);
                    }
                    ///----------------------end添加套餐-------------------------------------
                }
                else
                {
                    Dicttestitem _product = registerserver.SelectsTestItemListById(item.Id);
                    productList.Add(_product);
                }

                if ((Convert.ToInt32(item.Status)) >= ((int)daan.service.common.ParamStatus.OrderbarcodeStatus.Received))
                {
                    ReceivedBarcode += item.Barcode + ',';
                    // continue;
                }
                string str = registerserver.checkSex(item.Id, tbxSex.Label);
                if (str != string.Empty)
                {
                    MessageBoxShow(str); return;
                }

                Dicttestitem _groupitem;
                ///添加组合|项目
                _groupitem                   = new Dicttestitem();
                _groupitem                   = registerserver.SelectsTestItemListById(item.Id);
                _groupitem.IsActive          = item.Isactive; //是否停止测试
                _groupitem.Isadd             = item.Isadd;    ///是否追加
                _groupitem.Billed            = item.Billed;
                _groupitem.Sendbilled        = item.Sendbilled;
                _groupitem.Adduserid         = item.Adduserid;///追加人ID
                _groupitem.Sendoutcustomerid = item.Sendoutcustomerid;
                _groupitem.Tubegroup         = item.Tubegroup;
                _groupitem.Barcode           = item.Barcode;

                ////if (item.IsProduct)///套餐 取套餐ID和套餐名
                ////{
                _groupitem.Productid   = item.Productid;
                _groupitem.Productname = item.Productname;///套餐名
                ////}

                grouptestList.Add(_groupitem);
            }

            #endregion

            #region >>>> zhouy insert Orders
            Orders order   = registerserver.SelectOrderInfo(tbxOrderNum.Text);
            Orders _orders = order.Copy <Orders>();
            _orders.Ordernum       = tbxOrderNum.Text;                                           ///体检流水号
            _orders.Remarks        = tbxRemark.Text;                                             ///备注
            _orders.Dictmemberid   = Convert.ToDouble(tbxmemberID.Text);                         ///会员ID
            _orders.Dictcustomerid = customerid;                                                 ///所属客户ID
            _orders.Realname       = tbxName.Text;
            _orders.Sex            = tbxSex.Label;                                               ///性别 对应INITBASIC表
            _orders.Caculatedage   = AgeToHour(year, month, day, hour);                          ///计算后的年龄(小时为单位)
            _orders.Age            = string.Format("{0}岁{1}月{2}日{3}时", year, month, day, hour);; ///年龄字符串拼接 年月日时
            //_orders.Enterby = Userinfo.userName;///录入人 修改时不变
            _orders.Ordertestlst   = tbxItemTest.Text;                                           ///项目清单(冗余字段)
            _orders.Dictlabid      = labid;                                                      ///实验室分点
            _orders.Ordersource    = "1";
            _orders.Ismarried      = radlIsMarried.SelectedValue;                                ///婚否
            _orders.Section        = tbxSection.Text;                                            ///部门
            _orders.Lastupdatedate = date;
            // _orders.Createdate = date;
            #endregion
            string content = string.Empty;
            if (tbxItemTest.Label != tbxItemTest.Text)
            {
                content += string.Format("项目清单:[{0}]更改为[{1}],", tbxItemTest.Label, tbxItemTest.Text);
            }

            bool   isreceived = ReceivedBarcode.TrimEnd(',') != string.Empty;
            string error      = "";
            bool   b          = registerserver.insertUpdateOrders("追加项目", content, false, productList, grouptestList, null, _orders, ReceivedBarcode.TrimEnd(','), ref error);

            #region >>>> zhouy 执行结果 手续操作

            if (b)
            {
                PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
            }
            else
            {
                MessageBoxShow("保存失败:" + error);
            }

            #endregion
        }
        public void ToString_WhenGivenValidXml_ShouldReturnSameXml()
        {
            var xml1 = "<items><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">Manual</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6306?_download=true&amp;_ts=13ab17f5a82</documentUrl></item><item id=\"1\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">FDV dokumentasjon</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6305?_download=true&amp;_ts=13ab17f1573</documentUrl></item></items>";
            var xml2 = "<items><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">Installasjonsmanual</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6296?_download=true&amp;_ts=13ab176bd6a</documentUrl></item><item id=\"1\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">FDV dokumentasjon</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6295?_download=true&amp;_ts=13ab176537b</documentUrl></item></items>";

            var c1 = new GridRowCollection(xml1);
            var c2 = new GridRowCollection(xml2);

            var s1 = c1.ToString();
            var s2 = c2.ToString();

            Assert.AreEqual(s1, xml1);
            Assert.AreEqual(s2, xml2);
        }
Beispiel #28
0
 public GridTable()
 {
     this.cols = new GridColumnCollection(this);
     this.rows = new GridRowCollection(this);
 }
        public void New_WhenGivenInvalidXml_ShouldCreateGridRowCollection()
        {
            var xml = "<items><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">Manual</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6306?_download=true&amp;_ts=13ab17f5a82</documentUrl></item><item id=\"0\" sortOrder=\"0\"><documentName nodeName=\"\" nodeType=\"0\">FDV dokumentasjon</documentName><documentUrl nodeName=\"\" nodeType=\"0\">http://jotul.com/no/produkter.xml/_attachment/6305?_download=true&amp;_ts=13ab17f1573</documentUrl></item></items>";

            var c = new GridRowCollection(xml);
        }
        public void New_WhenGivenValidXml2_ShouldCreateGridRowCollection()
        {
            var xml = "<items><item id=\"1\" sortOrder=\"1\"><featureHeading nodeName=\"Feature Heading\" nodeType=\"-88\">Build your no claims discount fast with our Student Bonus Accelerator</featureHeading><featureDescription nodeName=\"Feature Description\" nodeType=\"1038\">If you don’t make a claim, you could build 2 years no claims discount in just 18 months. Even if you make a windscreen claim or have a claim where all costs are recovered, it won’t affect this offer.This exclusive offer is only available to students. If you’d like information on what happens if your occupation changes or you transfer your policy please see our terms and conditions.</featureDescription><featureAccordion nodeName=\"Feature Accordion (show/hide text)\" nodeType=\"1034\" /></item><item id=\"3\" sortOrder=\"2\"><featureHeading nodeName=\"Feature Heading\" nodeType=\"-88\">We’ll get you back on the road quicker</featureHeading><featureDescription nodeName=\"Feature Description\" nodeType=\"1038\">We settle quickly. One call to our team will help you with everything for your claim. Our mobile repair service, where possible, comes to you to save you time.</featureDescription><featureAccordion nodeName=\"Feature Accordion (show/hide text)\" nodeType=\"1034\" /></item><item id=\"2\" sortOrder=\"3\"><featureHeading nodeName=\"Feature Heading\" nodeType=\"-88\">24 hour windscreen and glass cover with our comprehensive policies</featureHeading><featureDescription nodeName=\"Feature Description\" nodeType=\"1038\">When you take out a comprehensive policy, you can rest assured that your windscreen and other glass is protected.This is a new para.</featureDescription><featureAccordion nodeName=\"Feature Accordion (show/hide text)\" nodeType=\"1034\" /></item></items>";

            var c = new GridRowCollection(xml);

            Assert.IsNotNull(c);
        }
Beispiel #31
0
        ///保存
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            GridRowCollection GridRow = GridTest.Rows;

            double?memberid = null;

            if (tbxmemberID.Text != string.Empty)
            {
                memberid = Convert.ToDouble(tbxmemberID.Text);
            }

            //获取系统时间时间
            DateTime?date = loginservice.GetServerTime();
            DateTime?datebirthday = null;
            int      year = 0, month = 0, day = 0, hour = 0;//年月日时
            double   customerid;
            //验证
            string msg = SaveCheck(date, out datebirthday, out year, out month, out day, out hour, out customerid);

            if (msg != string.Empty)
            {
                MessageBoxShow(msg); return;
            }

            List <Dicttestitem> grouptestList = new List <Dicttestitem>(); //订单中组合集合
            List <Dicttestitem> productList   = new List <Dicttestitem>(); //订单中套餐集合
            ///实验室分点
            double labid = Convert.ToDouble(DropDictLab.SelectedValue);
            List <Dicttestgroupdetail> TestGroupDetailList = loginservice.GetLoginDicttestgroupdetail();//组合项目字典
            //获取集合
            //List<OrderRegister> l = ViewState["GridTest"] as List<OrderRegister>;
            List <OrderRegister> _gridtestList = GetGridTest(true);
            //MessageBoxShow(l.Count.ToString() + "\t" + GridRow.Count.ToString());

            //return;

            //已接收的条码号
            string ReceivedBarcode = string.Empty;

            #region >>>> zhouy 获取订单中 组合,套餐

            for (int i = 0; i < _gridtestList.Count; i++)
            {
                OrderRegister item = _gridtestList[i];
                if (item.IsProduct)///套餐 去套餐ID和套餐名
                {
                    ///---------------------添加套餐-------------------------------------
                    ///不包含此套餐才添加
                    if (productList.Where(c => c.Dicttestitemid == item.Productid).Count() <= 0)
                    {
                        Dicttestitem _product = registerserver.SelectsTestItemListById(item.Productid);
                        productList.Add(_product);
                    }
                    ///----------------------end添加套餐-------------------------------------
                }
                else
                {
                    Dicttestitem _product = registerserver.SelectsTestItemListById(item.Id);
                    productList.Add(_product);
                }

                if ((Convert.ToInt32(item.Status)) >= ((int)daan.service.common.ParamStatus.OrderbarcodeStatus.Received))
                {
                    ReceivedBarcode += item.Barcode + ',';
                    //continue;
                }

                string str = registerserver.checkSex(item.Id, DropSex.SelectedValue);
                if (str != string.Empty)
                {
                    MessageBoxShow(str); return;
                }

                Dicttestitem _groupitem;
                ///添加组合|项目
                _groupitem                   = new Dicttestitem();
                _groupitem                   = registerserver.SelectsTestItemListById(item.Id);
                _groupitem.IsActive          = item.Isactive; //是否停止测试
                _groupitem.Isadd             = item.Isadd;    ///是否追加
                _groupitem.Billed            = item.Billed;
                _groupitem.Sendbilled        = item.Sendbilled;
                _groupitem.Adduserid         = item.Adduserid;///追加人ID
                _groupitem.Sendoutcustomerid = item.Sendoutcustomerid;
                _groupitem.Tubegroup         = item.Tubegroup;
                _groupitem.Barcode           = item.Barcode;
                _groupitem.Productid         = item.Productid;
                _groupitem.Productname       = item.Productname;///套餐名

                grouptestList.Add(_groupitem);
            }

            #endregion

            #region >>>> zhouy 会员信息

            Dictmember _member = new Dictmember();

            _member.Realname = tbxName.Text.Trim();
            _member.Idnumber = tbxIDNumber.Text == string.Empty ? "" : tbxIDNumber.Text;
            //检查会员
            string errstr = registerserver.checkmember(memberid, ref _member);
            if (errstr != string.Empty)
            {
                MessageBoxShow(errstr); return;
            }

            _member.Nickname = tbxName.Text;
            _member.Sex      = DropSex.SelectedValue;
            _member.Birthday = datebirthday;
            _member.Addres   = tbxAddres.Text;
            _member.Phone    = tbxPhone.Text;
            _member.Mobile   = tbxMobile.Text;
            _member.Email    = tbxEMail.Text;
            _member.Islock   = "F";///是否锁定

            #endregion


            #region >>>> zhouy insert Orders

            Orders order = registerserver.SelectOrderInfo(tbxOrderNum.Text);

            Orders _orders = order.Copy <Orders>();
            _orders.Ordernum       = tbxOrderNum.Text;                                           ///体检流水号
            _orders.Remarks        = tbxRemark.Text;                                             ///备注
            _orders.Dictmemberid   = _member.Dictmemberid;                                       ///会员ID
            _orders.Dictcustomerid = customerid;                                                 ///所属客户ID
            _orders.Realname       = _member.Nickname;
            _orders.Sex            = _member.Sex;                                                ///性别 对应INITBASIC表
            _orders.Caculatedage   = AgeToHour(year, month, day, hour);                          ///计算后的年龄(小时为单位)
            _orders.Age            = string.Format("{0}岁{1}月{2}日{3}时", year, month, day, hour);; ///年龄字符串拼接 年月日时
            _orders.Ordertestlst   = tbxItemTest.Text;                                           ///项目清单(冗余字段)
            _orders.Dictlabid      = labid;                                                      ///实验室分点
            _orders.Ordersource    = "1";
            _orders.Ismarried      = radlIsMarried.SelectedValue;                                ///婚否
            _orders.Section        = tbxSection.Text;                                            ///部门
            _orders.Lastupdatedate = date;                                                       //最后更新时间
            //省市区
            _orders.Province = dpProvince.SelectedValue == "-1"?"":dpProvince.SelectedText;
            _orders.City     = dpCity.SelectedValue == "-1" ? "" : dpCity.SelectedText;
            _orders.County   = dpCounty.SelectedValue == "-1" ? "" : dpCounty.SelectedText;
            //邮寄信息
            _orders.ContactNumber = txtCONTACTNUMBER.Text.Trim();
            _orders.Recipient     = txtRECIPIENT.Text.Trim();
            _orders.PostAddress   = txtPostAddress.Text.Trim();
            //营业区
            _orders.Area           = txtArea.Text.Trim();
            _orders.AccountManager = tbxAccountmanager.Text.Trim();
            //采样日期
            DateTime?spdate = null;
            if (dtSampleDate.Text != "")
            {
                spdate = Convert.ToDateTime(dtSampleDate.Text);
            }
            _orders.SamplingDate = spdate;
            #endregion

            string Content = string.Empty;
            ContrastObject(ref Content, _orders, order, _member);

            //是否有条码被物流接收
            bool   isreceived = ReceivedBarcode.TrimEnd(',') != string.Empty;
            string error      = "";
            bool   b          = registerserver.insertUpdateOrders("订单修改", Content, false, productList, grouptestList, _member, _orders, ReceivedBarcode.TrimEnd(','), ref error);
            if (b)
            {
                if (isreceived && (Content.Contains("年龄") || Content.Contains("性别")))//物流接受 则需要提示通知
                {
                    MessageBoxShow("该订单标本已被实验室接收,修改了年龄或者性别,请通知实验室");
                }
                PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
            }
            else
            {
                MessageBoxShow("保存失败:" + error);
            }
        }
Beispiel #32
0
 public virtual void StartDragDrop()
 {
     GridRowCollection rows = new GridRowCollection();
     foreach (GridRow row in RowsAndChildren)
     {
         if (row.Selected && IsDraggableRow(row))
             rows.Add(row);
     }
     if (rows.Count > 0)
         DoDragDrop(rows, DragDropEffects.Move);
 }