当前位置: 首页>>代码示例>>C#>>正文


C# People.SetResidentGeo3方法代码示例

本文整理汇总了C#中People.SetResidentGeo3方法的典型用法代码示例。如果您正苦于以下问题:C# People.SetResidentGeo3方法的具体用法?C# People.SetResidentGeo3怎么用?C# People.SetResidentGeo3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在People的用法示例。


在下文中一共展示了People.SetResidentGeo3方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ImportPeople

        private static Guid? ImportPeople(RedBloodDataContext db, People outerP)
        {
            //Importing people
            if (outerP == null || db == null) return null;

            PeopleBLL bll = new PeopleBLL();

            People innerP = db.Peoples.Where(r => r.ID == outerP.ID).FirstOrDefault();

            //People innerP = bll.GetByID(outerP.ID);

            if (innerP == null)
            {
                People newP = new People();

                newP.Name = outerP.Name;
                newP.DOB = outerP.DOB;
                newP.DOBYear = outerP.DOBYear;
                newP.CMND = outerP.CMND;
                newP.SexID = outerP.SexID;

                GeoBLL.Insert(
                    outerP.ResidentGeo1 != null ? outerP.ResidentGeo1.Name : ""
                    , outerP.ResidentGeo2 != null ? outerP.ResidentGeo2.Name : ""
                    , outerP.ResidentGeo3 != null ? outerP.ResidentGeo3.Name : "");

                newP.ResidentAddress = outerP.ResidentAddress;
                newP.SetResidentGeo3(outerP.FullResidentalGeo);

                if (outerP.EnableMailingAddress.HasValue
                    && outerP.EnableMailingAddress.Value)
                {
                    GeoBLL.Insert(
                    outerP.MailingGeo1 != null ? outerP.MailingGeo1.Name : ""
                    , outerP.MailingGeo2 != null ? outerP.MailingGeo2.Name : ""
                    , outerP.MailingGeo3 != null ? outerP.MailingGeo3.Name : "");

                    newP.MailingAddress = outerP.MailingAddress;
                    newP.SetMailingGeo3(outerP.FullMaillingGeo);

                    newP.EnableMailingAddress = outerP.EnableMailingAddress;
                }

                newP.Job = outerP.Job;
                newP.Email = outerP.Email;
                newP.Phone = outerP.Phone;
                newP.Note = outerP.Note;

                db.Peoples.InsertOnSubmit(newP);
                db.SubmitChanges();

                return newP.ID;
            }
            else
            {
                innerP.CMND = outerP.CMND;
                innerP.DOB = outerP.DOB;
                innerP.DOBYear = outerP.DOBYear;
                innerP.Email = outerP.Email;
                innerP.EnableMailingAddress = outerP.EnableMailingAddress;
                innerP.Job = outerP.Job;
                innerP.MailingAddress = outerP.MailingAddress;
                innerP.ResidentAddress = outerP.ResidentAddress;

                try
                {
                    innerP.MailingGeoID1 = outerP.MailingGeoID1;
                    innerP.MailingGeoID2 = outerP.MailingGeoID2;
                    innerP.MailingGeoID3 = outerP.MailingGeoID3;

                    innerP.ResidentGeoID1 = outerP.ResidentGeoID1;
                    innerP.ResidentGeoID2 = outerP.ResidentGeoID2;

                    //if (outerP.ResidentGeo2 != null
                    //    && innerP.ResidentGeoID2 == new Guid("bebb4f9b-e54f-4abe-b634-b6441245cec2")
                    //    && outerP.ResidentGeo2.Name == "Phú Riềng")
                    //{
                    //    innerP.ResidentGeoID2 = new Guid("C61F5AC0-702E-4EDA-BB54-0904115F618B");
                    //}

                    innerP.ResidentGeoID3 = outerP.ResidentGeoID3;

                }
                catch (Exception)
                {

                }

                innerP.Name = outerP.Name;
                innerP.Note = outerP.Note;
                innerP.Phone = outerP.Phone;

                innerP.SexID = outerP.SexID;

                db.SubmitChanges();

                return innerP.ID;
            }
        }
开发者ID:ghostnguyen,项目名称:daccf960-44f9-4f95-91c4-b1aba37effe1,代码行数:99,代码来源:ImportBLL.cs

示例2: LoadFromGUI

    private bool LoadFromGUI(People p)
    {
        bool isDone = true;

        try
        {
            p.Name = txtName.Text.Trim();
            divErrName.Attributes["class"] = "hidden";
        }
        catch (Exception ex)
        {
            divErrName.InnerText = ex.Message;
            divErrName.Attributes["class"] = "err";
            isDone = false;
        }

        try
        {
            p.SetDOBFromVNFormat(txtDOB.Text.Trim(), true);
            divErrDOB.Attributes["class"] = "hidden";
        }
        catch (Exception ex)
        {
            divErrDOB.Attributes["class"] = "err";
            divErrDOB.InnerText = ex.Message;
            isDone = false;
        }

        try
        {
            p.CMND = txtCMND.Text.Trim();
            divErrCMND.Attributes["class"] = "hidden";
        }
        catch (Exception ex)
        {
            divErrCMND.InnerText = ex.Message;
            divErrCMND.Attributes["class"] = "err";
            isDone = false;
        }

        if (ddlSex.SelectedValue.ToGuid() == Guid.Empty)
        {
            //p.SexID = null;
            divErrSex.Attributes["class"] = "err";
            divErrSex.InnerText = "Chọn giới tính";
            isDone = false;
        }
        else
        {
            p.SexID = ddlSex.SelectedValue.ToGuid();
            divErrSex.Attributes["class"] = "hidden";
        }

        p.ResidentAddress = txtResidentAddress.Text.Trim();

        try
        {
            p.SetResidentGeo3(txtResidentGeo.Text.Trim());
            divErrResidentalGeo.Attributes["class"] = "hidden";
        }
        catch (Exception ex)
        {
            divErrResidentalGeo.Attributes["class"] = "err";
            divErrResidentalGeo.InnerText = ex.Message;
            isDone = false;
        }

        p.EnableMailingAddress = chkEnableMaillingAddress.Checked;
        p.MailingAddress = txtMailingAddress.Text.Trim();

        if (p.EnableMailingAddress.Value)
        {
            try
            {
                p.SetMailingGeo3(txtMailingGeo.Text.Trim());
                divErrMailingGeo.Attributes["class"] = "hidden";
            }
            catch (Exception ex)
            {
                divErrMailingGeo.Attributes["class"] = "err";
                divErrMailingGeo.InnerText = ex.Message;
                isDone = false;
            }
        }

        p.Job = txtJob.Text;
        p.Email = txtEmail.Text;
        p.Phone = txtPhone.Text;
        p.Note = txtNote.Text;

        return isDone;
    }
开发者ID:ghostnguyen,项目名称:daccf960-44f9-4f95-91c4-b1aba37effe1,代码行数:92,代码来源:People.ascx.cs

示例3: ImportPeople

    private static Guid? ImportPeople(RedBloodDataContext db, People outerP)
    {
        //Importing people
        if (outerP == null || db == null) return null;

        People innerP = PeopleBLL.GetByID(outerP.ID);

        if (innerP == null)
        {
            People newP = new People();

            newP.Name = outerP.Name;
            newP.DOB = outerP.DOB;
            newP.DOBYear = outerP.DOBYear;
            newP.CMND = outerP.CMND;
            newP.SexID = outerP.SexID;

            GeoBLL.Insert(
                outerP.ResidentGeo1 != null ? outerP.ResidentGeo1.Name : ""
                , outerP.ResidentGeo2 != null ? outerP.ResidentGeo2.Name : ""
                , outerP.ResidentGeo3 != null ? outerP.ResidentGeo3.Name : "");

            newP.ResidentAddress = outerP.ResidentAddress;
            newP.SetResidentGeo3(outerP.FullResidentalGeo);

            if (outerP.EnableMailingAddress.HasValue
                && outerP.EnableMailingAddress.Value)
            {
                GeoBLL.Insert(
                outerP.MailingGeo1 != null ? outerP.MailingGeo1.Name : ""
                , outerP.MailingGeo2 != null ? outerP.MailingGeo2.Name : ""
                , outerP.MailingGeo3 != null ? outerP.MailingGeo3.Name : "");

                newP.MailingAddress = outerP.MailingAddress;
                newP.SetMailingGeo3(outerP.FullMaillingGeo);

                newP.EnableMailingAddress = outerP.EnableMailingAddress;
            }

            newP.Job = outerP.Job;
            newP.Email = outerP.Email;
            newP.Phone = outerP.Phone;
            newP.Note = outerP.Note;

            db.Peoples.InsertOnSubmit(newP);
            db.SubmitChanges();

            return newP.ID;
        }
        else
        {
            return innerP.ID;
        }
    }
开发者ID:ghostnguyen,项目名称:redblood,代码行数:54,代码来源:ImportBLL.cs


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