• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DTO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DTO的典型用法代码示例。如果您正苦于以下问题:C# DTO类的具体用法?C# DTO怎么用?C# DTO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DTO类属于命名空间,在下文中一共展示了DTO类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UcDetail

        public UcDetail(DTO.SanPham data)
        {
            InitializeComponent();

            this.data = data;

            if (Init())
            {
                tbMa.Text = data.MaSanPham;
                cbGroup.Text = data.SanPhamGroup.Ten;
                tbTen.Text = data.Ten;

                if (data.IsActive)
                {
                    rbBan.Checked = true;
                }
                else
                {
                    rbTamNgung.Checked = true;
                }

                tbMoTa.Text = data.MoTa;
            }
            else
            {
                this.Visible = false;
            }
        }
开发者ID:vuchannguyen,项目名称:lg-py,代码行数:28,代码来源:UcDetail.cs


示例2: Save

        public void Save(DTO.Macro item)
        {
            using (var sqlMacro = new DataLayer.RemoteHelperDataContext())
            {
                if (item.Id.HasValue)
                {
                    var items_to_delete = (from itms in sqlMacro.MacroSteps
                                           where itms.MacroId == item.Id
                                           select itms);
                    foreach (var item_to_delete in items_to_delete)
                    {
                        sqlMacro.MacroSteps.DeleteOnSubmit(item_to_delete);
                    }
                    
                }

                if (item.Steps != null && item.Steps.Count > 0)
                    foreach (var item_to_insert in item.Steps)
                    {
                        var tmp = new DataLayer.MacroStep
                        {
                            CommandLine = null,
                            SequenceNumber = item_to_insert.SequenceNumber
                        };                        
                        
                        sqlMacro.MacroSteps.InsertOnSubmit(tmp);
                    }

                sqlMacro.SubmitChanges();
            }
        }
开发者ID:kamilskoczylas,项目名称:RemoteHelper,代码行数:31,代码来源:MacroDataReader.cs


示例3: Create

        public static int Create(DTO.MAD_Transportation item)
        {
            int result = 0;
            DataProvider.ConnectionVanTai conn = null;
            try
            {
                conn = new DataProvider.ConnectionVanTai();
                conn.Open();
                List<System.Data.SqlClient.SqlParameter> lsInput = new List<System.Data.SqlClient.SqlParameter>();
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@TransportationNo_", item.TransportationNo_.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@TransportationName", item.TransportationName.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@RoMooc", item.RoMooc.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@Status", item.Status));
                result = conn.ExecuteNonQuery("sp_MAD_Transportation_Create", lsInput);

            }
            catch (Exception ex)
            {
                result = -1;
            }
            finally
            {
                conn.Close();
            }
            return result;
        }
开发者ID:tmtien05,项目名称:WebVanTai,代码行数:26,代码来源:MAD_Transportation.cs


示例4: ThemLOAIKH

 public void ThemLOAIKH(DTO.DTOLOAIKH e)
 {
     List<SqlParameter> parameters = new List<SqlParameter>();
     parameters.Add(new SqlParameter("@MALOAIKH", e.MALOAIKH));
     parameters.Add(new SqlParameter("@TENLOAIKH", e.TENLOAIKH));
     conn.ExecuteProcedure("THEMVAOLOAIKH",parameters);
 }
开发者ID:WendyAnne,项目名称:Hotel-software,代码行数:7,代码来源:daoLOAIKH.cs


示例5: CapnhatKIEUPHONG

 public void CapnhatKIEUPHONG(DTO.DTOKIEUPHONG e)
 {
     List<SqlParameter> parameters = new List<SqlParameter>();
     parameters.Add(new SqlParameter("@MAKP", e.MAKP));
     parameters.Add(new SqlParameter("@TENKP", e.TENKP));
     conn.ExecuteProcedure("CAPNHATKIEUPHONG",parameters);
 }
开发者ID:WendyAnne,项目名称:Hotel-software,代码行数:7,代码来源:daoKIEUPHONG.cs


示例6: ThemTINHTRANG

 public void ThemTINHTRANG(DTO.DTOTINHTRANG e)
 {
     List<SqlParameter> parameters = new List<SqlParameter>();
     parameters.Add(new SqlParameter("@MATT", e.MATT));
     parameters.Add(new SqlParameter("@TENTT", e.TENTT));
     conn.ExecuteProcedure("THEMVAOTINHTRANG",parameters);
 }
开发者ID:WendyAnne,项目名称:Hotel-software,代码行数:7,代码来源:daoTINHTRANG.cs


示例7: Create

        public static int Create(DTO.SAM_DriverShipment item)
        {
            int result = 0;
            DataProvider.ConnectionVanTai conn = null;
            try
            {
                conn = new DataProvider.ConnectionVanTai();
                conn.Open();
                List<System.Data.SqlClient.SqlParameter> lsInput = new List<System.Data.SqlClient.SqlParameter>();
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ShipmentNo_", item.ShipmentNo_));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@TransportationNo_", item.TransportationNo_));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@UserNo_", item.UserNo_));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@IsDriver", item.IsDriver));
                result = conn.ExecuteNonQuery("sp_SAM_DriverShipment_Create", lsInput);

            }
            catch (Exception ex)
            {
                result = -1;
            }
            finally
            {
                conn.Close();
            }
            return result;
        }
开发者ID:tmtien05,项目名称:WebVanTai,代码行数:26,代码来源:SAM_DriverShipment.cs


示例8: CreateNewPalestrante

        public DTO.Palestrante CreateNewPalestrante(DTO.Palestrante palestrante)
        {
            using (var db = new SemanaTecnologiaEntities())
            {
                var PalestranteRow = db.Palestrante.Create();

                PalestranteRow.NAME = palestrante.NAME;

                PalestranteRow.EMAIL = palestrante.EMAIL;

                PalestranteRow.CV = palestrante.CV;

                PalestranteRow.CITY = palestrante.CITY;

                PalestranteRow.TEL = palestrante.TEL;

                PalestranteRow.TITRATION = palestrante.TITRATION;

                db.Palestrante.Add(PalestranteRow);

                db.SaveChanges();

                palestrante.PK_PALESTRANTE = PalestranteRow.PK_PALESTRANTE;

                return palestrante;

            }
        }
开发者ID:Molax,项目名称:registration-simulator,代码行数:28,代码来源:Palestrante.cs


示例9: Create

        public static int Create(DTO.MAD_Employee item)
        {
            int result = 0;
            DataProvider.ConnectionVanTai conn = null;
            try
            {
                conn = new DataProvider.ConnectionVanTai();
                conn.Open();
                List<System.Data.SqlClient.SqlParameter> lsInput = new List<System.Data.SqlClient.SqlParameter>();
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@EmployeeNo_", item.EmployeeNo_));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@EmployeeName", item.EmployeeName));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@EmployeeType", item.EmployeeType));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@IdentityCard", item.IdentityCard));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@Cellphone", item.Cellphone));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@BeginDate", item.BeginDate));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@Status", item.Status));
                result = conn.ExecuteNonQuery("sp_MAD_Employee_Create", lsInput);

            }
            catch (Exception ex)
            {
                result = -1;
            }
            finally
            {
                conn.Close();
            }
            return result;
        }
开发者ID:tmtien05,项目名称:WebVanTai,代码行数:29,代码来源:MAD_Employee.cs


示例10: CreateDataShapedObject

        public object CreateDataShapedObject(DTO.Expense expense, List<string> lstOfFields)
        {
            if (!lstOfFields.Any())
            {
                return expense;
            }
            else
            {

                // create a new ExpandoObject & dynamically create the properties for this object

                ExpandoObject objectToReturn = new ExpandoObject();
                foreach (var field in lstOfFields)
                {
                    // need to include public and instance, b/c specifying a binding flag overwrites the
                    // already-existing binding flags.

                    var fieldValue = expense.GetType()
                        .GetProperty(field, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance)
                        .GetValue(expense, null);

                    // add the field to the ExpandoObject
                    ((IDictionary<String, Object>)objectToReturn).Add(field, fieldValue);
                }

                return objectToReturn;
            }
        }
开发者ID:dimchen,项目名称:apiTest,代码行数:28,代码来源:ExpenseFactory.cs


示例11: Create

        public static int Create(DTO.SAM_Contract item)
        {
            int result = 0;
            DataProvider.ConnectionVanTai conn = null;
            try
            {
                conn = new DataProvider.ConnectionVanTai();
                conn.Open();
                List<System.Data.SqlClient.SqlParameter> lsInput = new List<System.Data.SqlClient.SqlParameter>();
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ContractNo_", item.ContractNo_.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@CreatedUser", item.CreatedUser.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@CreatedDate", item.CreatedDate));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@PartnerNo_", item.PartnerNo_.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ContractValue", item.ContractValue));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@Status", item.Status));
                result = conn.ExecuteNonQuery("sp_SAM_Contract_Create", lsInput);

            }
            catch (Exception ex)
            {
                result = -1;
            }
            finally
            {
                conn.Close();
            }
            return result;
        }
开发者ID:tmtien05,项目名称:WebVanTai,代码行数:28,代码来源:SAM_Contract.cs


示例12: UcInfo

        public UcInfo(DTO.SanPham data)
        {
            InitializeComponent();

            this.data = data;
            isUpdate = true;
            lbSelect.Text = Constant.DEFAULT_TITLE_EDIT;

            if (Init())
            {
                tbMa.Text = data.MaSanPham;
                tbTen.Text = data.Ten;

                if (data.IsActive)
                {
                    rbBan.Checked = true;
                }
                else
                {
                    rbTamNgung.Checked = true;
                }

                tbMoTa.Text = data.MoTa;

                cbGroup.Text = data.SanPhamGroup.Ten;
            }
            else
            {
                this.Visible = false;
            }
        }
开发者ID:vuchannguyen,项目名称:lg-py,代码行数:31,代码来源:UcInfo.cs


示例13: CreateNewParticipante

        public DTO.Participante CreateNewParticipante(DTO.Participante participante)
        {
            using (var db = new SemanaTecnologiaEntities())
            {

                var ParticipanteROW = db.Participante.Create();

                ParticipanteROW.PK_PARTICIPANTE = participante.PK_PARTICIPANTE;

                ParticipanteROW.COURSE = participante.COURSE;

                ParticipanteROW.EMAIL = participante.EMAIL;

                ParticipanteROW.LOGIN = participante.LOGIN;

                ParticipanteROW.NAME = participante.NAME;

                ParticipanteROW.PASSWORD = participante.PASSWORD;

                ParticipanteROW.PERIOD = participante.PERIOD;

                ParticipanteROW.PROFILE = participante.PROFILE;

                ParticipanteROW.TEL = participante.TEL;

                db.Participante.Add(ParticipanteROW);

                db.SaveChanges();

                return participante;

            }
        }
开发者ID:Molax,项目名称:registration-simulator,代码行数:33,代码来源:Participante.cs


示例14: Create

        public static int Create(DTO.SAM_SalesPrice item)
        {
            int result = 0;
            DataProvider.ConnectionVanTai conn = null;
            try
            {
                conn = new DataProvider.ConnectionVanTai();
                conn.Open();
                List<System.Data.SqlClient.SqlParameter> lsInput = new List<System.Data.SqlClient.SqlParameter>();
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ID", item.ID));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ContractNo_", item.ContractNo_.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@RouteNo_", item.RouteNo_.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ItemNo_", item.ItemNo_.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@UnitOfMeasure", item.UnitOfMeasure.Trim()));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@FromDate", item.FromDate));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@ToDate", item.ToDate));
                lsInput.Add(new System.Data.SqlClient.SqlParameter("@UnitPrice", item.UnitPrice));
                result = conn.ExecuteNonQuery("sp_SAM_SalesPrice_Create", lsInput);

            }
            catch (Exception ex)
            {
                result = -1;
            }
            finally
            {
                conn.Close();
            }
            return result;
        }
开发者ID:tmtien05,项目名称:WebVanTai,代码行数:30,代码来源:SAM_SalesPrice.cs


示例15: ThemtblMODULE

 public void ThemtblMODULE(DTO.DTOtblMODULE e)
 {
     List<SqlParameter> parameters = new List<SqlParameter>();
     parameters.Add(new SqlParameter("@MODULEID", e.MODULEID));
     parameters.Add(new SqlParameter("@MODULENAME", e.MODULENAME));
     conn.ExecuteProcedure("THEMVAOtblMODULE",parameters);
 }
开发者ID:WendyAnne,项目名称:Hotel-software,代码行数:7,代码来源:daotblMODULE.cs


示例16: SMA

 public SMA(DTO.DuLieuMaCK DLDK)
 {
     InitializeComponent();
     ms = new BUS.Multi_Stock();
     ms.ConvertFromDuLieuMaCk(DLDK);
     dldk = DLDK.LayDuLieu();
 }
开发者ID:hksonngan,项目名称:mytesgnikrow,代码行数:7,代码来源:SMA.cs


示例17: CapnhatTINHTRANG

 public void CapnhatTINHTRANG(DTO.DTOTINHTRANG e)
 {
     List<SqlParameter> parameters = new List<SqlParameter>();
     parameters.Add(new SqlParameter("@MATT", e.MATT));
     parameters.Add(new SqlParameter("@TENTT", e.TENTT));
     conn.ExecuteProcedure("CAPNHATTINHTRANG",parameters);
 }
开发者ID:WendyAnne,项目名称:Hotel-software,代码行数:7,代码来源:daoTINHTRANG.cs


示例18: BosPaper

		// konstruktor, wywoływany spod BosPapers.Update()
		internal BosPaper(BosAccount account, DTO.Paper data)
		{
			Account = account;
			Instrument = BosInstrument.Create(data.Instrument);
			Quantity110 = data.Account110;
			Quantity120 = data.Account120;
		}
开发者ID:rafalkrupinski,项目名称:bossa-api.net,代码行数:8,代码来源:BosPaper.cs


示例19: BosTrade

		// konstruktor, wywoływany spod BosTrades.Update()
		internal BosTrade(DTO.MarketTradeData data)
		{
			Time = data.Time;
			Price = data.Price;
			Quantity = data.Quantity;
			//OpenInt uzupełniamy w BosInstrument.Update
		}
开发者ID:rafalkrupinski,项目名称:bossa-api.net,代码行数:8,代码来源:BosTrade.cs


示例20: TicketDetail

        public TicketDetail(DTO.Ticket t)
        {
            this.Id = t.Id;
            this.Summary = t.Summary;
            this.Priority = t.Priority;
            this.CreatedOn = t.CreatedOn;
            this.UpdatedAt = t.UpdatedAt;
            this.MilestoneId = t.MilestoneId;
            this.StatusName = t.StatusName;
            this.AssignedTo = t.AssignedTo;
            this.CompletedDate = t.CompletedDate;
            this.ComponentId = t.ComponentId;
            this.CustomFields = t.CustomFields;
            this.Description = t.Description;
            this.Estimate = t.Estimate;
            this.Followers = t.Followers;
            this.Importance = t.Importance;
            this.IsOpen = t.IsOpen;
            this.IsStory = t.IsStory;
            this.Number = t.Number;
            this.StoryImportance = t.StoryImportance;

            Component = t.Component;
            Milestone = t.Milestone;
            Assignee = t.Assignee;
            Reporter = t.Reporter;
        }
开发者ID:GrantDG,项目名称:nAssembla,代码行数:27,代码来源:TicketDetail.cs



注:本文中的DTO类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DTcms类代码示例发布时间:2022-05-24
下一篇:
C# DTE2类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap