protected void submitFacility(Object sender, EventArgs e)
        {
            //If null then this is creating a facility to add
            if (selected_facility == null)
            {
                selected_facility = new facility();
                selected_address = new address();
                selected_address.line_1 = Address1.Text;
                selected_address.line_2 = Address2.Text;
                selected_address.city = CityName.Text;
                selected_address.state = StateName.Text;
                selected_address.zip = ZipName.Text;
                db.addresses.InsertOnSubmit(selected_address);
                db.SubmitChanges();
                selected_facility.user_id = user_id;
                selected_facility.name = FacilityName.Text;
                selected_facility.address_id = selected_address.id;
                selected_facility.add_date = DateTime.Now;
                db.facilities.InsertOnSubmit(selected_facility);
                db.SubmitChanges();

            }
            //If not then we are editing an existing facility
            else
            {
                selected_facility.name = FacilityName.Text;
                selected_address.line_1 = Address1.Text;
                selected_address.line_2 = Address2.Text;
                selected_address.city = CityName.Text;
                selected_address.state = StateName.Text;
                selected_address.zip = ZipName.Text;
                db.SubmitChanges();
            }
            Response.Redirect("~/Pages/Inventory/Facilities.aspx");
        }
Exemple #2
0
        public DriverForm(driver d)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            lbBirthday.Text = "";
            bdgState.DataSource = state.Fetch("");
            address ad;
            if (d == null)
                IsNew = true;
            if (IsNew)
            {
                d = new driver() { birthday = null, admitted_at = null, dismissed_at = null, genre = -1 };
                ad = new address();
                btnFiles.Enabled = false;
            }
            else
            {
                ad = address.SingleOrDefault(d.address);
                tfCpf.Properties.ReadOnly = true;
                //tfNumberCnh.Properties.ReadOnly = true;

                if (d.inactive)
                {
                    pnGeneral.Enabled = false;
                    btnSave.Visible = false;
                }
            }
            bdgAddress.DataSource = ad;
            bdgDriver.DataSource = d;
            DateTime now = driver.Now();
            tfBirthday.Properties.MaxValue = now;
            tfAdmittedAt.Properties.MaxValue = now;
            tfDismissedAt.Properties.MaxValue = now;
        }
Exemple #3
0
        public CustomerForm(customer c)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            bdgStates.DataSource = state.Fetch("ORDER BY symbol");
            address d;
            if (c == null)
                IsNew = true;

            if (IsNew)
            {
                c = new customer();
                d = new address();
            }
            else
            {
                d = address.SingleOrDefault(c.address_id);
                tfCnpj.Properties.ReadOnly = true;
                tfIE.Properties.ReadOnly = true;
                rgType.Properties.ReadOnly = true;
                if (c.inactive || c.is_business)
                {
                    pnData.Enabled = false;
                    pnAddress.Enabled = false;
                }
            }
            bdgCustomer.DataSource = c;
            bdgAddress.DataSource = d;
        }
 /// <summary>
 /// Calls the Post method of the MessageDisposed Service
 /// </summary>
 /// <param name="messageId">MessageId of the message to be marked as Disposed</param>
 /// <param name="address">Recipient Address Related to Disposition</param>
 /// <param name="dispositionType">Disposition Type</param>
 /// <param name="certificate">Client Certificate</param>
 /// <returns>True if Successful</returns>
 public static bool Post(Guid messageId, address address, dispositionType dispositionType, X509Certificate2 certificate)
 {
     using (var client = getMessagesClient(certificate))
     {
         return client.post(messageId, address, dispositionType);
     }
 }
Exemple #5
0
 public void loadFromCnpj(customer c, address d)
 {
     rgType.EditValue = c.type;
     bdgCustomer.DataSource = c;
     bdgAddress.DataSource = d;
     IsNew = true;
     subPnData.Enabled = true;
     pnAddress.Enabled = true;
 }
Exemple #6
0
 public void update(address editItem)
 {
     address selectedItem = db.addresses.SingleOrDefault(item => item.id == editItem.id);
     selectedItem.buildingname = editItem.buildingname;
     selectedItem.houseno = editItem.houseno;
     selectedItem.street = editItem.street;
     selectedItem.locality = editItem.locality;
     selectedItem.postaltown = editItem.postaltown;
     selectedItem.country = editItem.country;
     selectedItem.postcode_id = editItem.postcode_id;
     db.SaveChanges();
 }
 public address address_update(int ID)
 {
     address = address.Select(ID);
     address.city = Update_Client_city_txt.Text;
     address.country = Update_Client_country_txt.Text;
     address.County_Township = Update_Client_County_Township_txt.Text;
     address.longitude = Convert.ToDecimal(Update_Client_longitude_txt.Text);
     address.latitude = Convert.ToDecimal(Update_Client_latitude_txt.Text);
     address.state = Update_Client_state_txt.Text;
     address.str_add = Update_Client_str_add_txt.Text;
     address.str_add2 = Update_Client_str_add2_txt.Text;
     address.zip_plus_four = Update_Client_zip_plus_four_txt.Text;
     address.Update(address);
     //GridView1.DataBind();
     return address;
 }
 /////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////
 //////////////////////
 //Methods To Call
 //INSERT
 public address address_insert()
 {
     address.address_type_id = 1;
     address.city = Insert_Client_city_txt.Text;
     address.country = Insert_Client_country_txt.Text;
     address.County_Township = Insert_Client_County_Township_txt.Text;
     address.longitude = Convert.ToDecimal(Insert_Client_longitude_txt.Text);
     address.latitude = Convert.ToDecimal(Insert_Client_latitude_txt.Text);
     address.state = Insert_Client_state_txt.Text;
     address.str_add = Insert_Client_str_add_txt.Text;
     address.str_add2 = Insert_Client_str_add2_txt.Text;
     address.zip_plus_four = Insert_Client_zip_plus_four_txt.Text;
     address = address.Insert(address);
     //GridView1.DataBind();
     return address;
 }
        public CredentialedForm(credentialed c)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            try
            {
                SplashScreenManager.ShowForm(null, typeof(PleaseWaitForm), false, false, false);
                if (c == null)
                {
                    c = new credentialed();
                    _address = new address();
                    btnInactive.Enabled = false;
                    IsNew = true;
                }
                else
                {
                    peLogo.Image = new FTPUtil().getImageFromFile(c.directory_logo);
                    pCNPJ.Enabled = false;
                    _address = address.SingleOrDefault(c.address_id);
                    pData.Enabled = true;

                    if (c.inactive)
                    {
                        btnInactive.Visible = false;
                        btnSave.Visible = false;
                        //pData.Enabled = false;
                    }
                    else
                        btnReceivePayment.Enabled = true;
                    IsNew = false;
                }

                bdgStates.DataSource = state.Fetch("");

                bdgCredentialed.DataSource = c;
                bdgAddress.DataSource = _address;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(String.Format("Ocorreu um erro:\n\n{0}\n{1}", ex.Message, ex.InnerException));
                btnSave.Enabled = false;
            }
            finally
            {
                SplashScreenManager.CloseForm(false);
            }
        }
Exemple #10
0
        public CustomerForm(customer c)
        {
            try
            {
                SplashScreenManager.ShowForm(null, typeof(PleaseWaitForm), false, false, false);
                address ad;
                InitializeComponent();
                ControlsUtil.SetBackColor(this.Controls);
                if (c == null)
                {
                    c = new customer();
                    ad = new address();
                    IsNew = true;
                }
                else
                {
                    IsNew = false;
                    ad = address.SingleOrDefault(c.address_id);
                    foreach (phones_customer pc in phones_customer.Fetch("WHERE customer_id=@0", c.id))
                        listPhones.Items.Add(pc.phone);
                    pePicture.Image = new FTPUtil().getImageFromFile(c.directory_picture);
                    cbOrganEmitter.EditValue = c.organ_emitter_rg.Split('/')[0];
                    cbStateRG.EditValue = c.organ_emitter_rg.Split('/')[1];
                }

                List<state> listS = state.Fetch("");
                bdgStates.DataSource = listS;
                foreach (state e in listS)
                    cbStateRG.Properties.Items.Add(e.symbol);
                bdgOrganEmitter.DataSource = organ_emitter.Fetch("");
                bdgAddress.DataSource = ad;
                bdgCustomer.DataSource = c;

                Validations.ValidatorCPFCNPJ vcpf = new Validations.ValidatorCPFCNPJ() { ErrorText = "O CPF informado é inválido." };
                validatorCustomer.SetValidationRule(tfCPF, vcpf);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(String.Format("Ocorreu um erro.\n\n{0}\n{1}", ex.Message, ex.InnerException));
            }
            finally
            {
                SplashScreenManager.CloseForm(false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.RouteData.Values["facility_id"] != null)
            {
                facility_id = Convert.ToInt32(Page.RouteData.Values["facility_id"]);
                selected_facility = (from f in db.facilities
                                     where f.id == facility_id
                                     select f).Single();
                selected_address = (from a in db.addresses
                                    where a.id == selected_facility.address_id
                                    select a).Single();

                if (!Page.IsPostBack)
                {
                    FacilityName.Text = selected_facility.name;
                    Address1.Text = selected_address.line_1;
                    Address2.Text = selected_address.line_2;
                    CityName.Text = selected_address.city;
                    StateName.Text = selected_address.state;
                    ZipName.Text = selected_address.zip;
                }
            }
        }
Exemple #12
0
 public void insert(address newItem)
 {
     db.addresses.Add(newItem);
     db.SaveChanges();
 }
        protected void updateDatabase()
        {
            //product_id_array has all product ids
            call_center = call_center.Select(Convert.ToInt32(DDL_Call_Center.SelectedValue));
            selected_Warehouse = selected_Warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address = address.Select(selected_Warehouse.address_id);

            //case_intake
            case_intake = case_intake_insert();
            //encounter
            encounter = encounter_insert();
            //requestor
            requestor = requestor_insert();
            //requestor_Order
            requestor_Order = requestor_Order_insert();
            //Order_product
            Order_Product = Order_Product_insert();
        }
Exemple #14
0
 public orderDto()
 {
     address = new address();
 }
        protected void Save_Client_information()
        {
            decimal[] add1cord = new decimal[2];
            decimal[] add2cord = new decimal[2];

            clientperson.SetColumnDefaults();
            clientAddress.SetColumnDefaults();
            clientAddress2.SetColumnDefaults();
            client.SetColumnDefaults();

            clientperson.person_id = GlobalVariables.PersonID;
            clientperson.address_id = GlobalVariables.ClientAddressID;
            clientperson.address_id2 = GlobalVariables.ClientAddressID2;
            clientAddress.address_id = GlobalVariables.ClientAddressID;
            clientAddress2.address_id = GlobalVariables.ClientAddressID2;

            client.client_id = GlobalVariables.ClientID;
            client.Info_Field = null;

            clientperson.f_name = txt_F_Name.Text;
            clientperson.l_name = txt_L_Name.Text;
            clientperson.person_type = "C";
            clientperson.m_initial = txt_M_Initial.Text;
            clientperson.Maiden_Name = txt_Maiden_Name.Text;
            clientperson.gender = ddl_Gender.SelectedValue;
            clientperson.email = txt_email.Text;
            if (txt_SSN.Text != "")
            {
                clientperson.ssn = Convert.ToInt32(txt_SSN.Text);
            }
            clientperson.Driver_State_ID = txt_DrvLic.Text;
            if (txt_Birthdate.Text != "")
            {
                clientperson.birthdate = Convert.ToDateTime(txt_Birthdate.Text);
            }
            clientperson.phone_primary = txt_Phone_Primary.Text;
            clientperson.phone_secondary = txt_Phone_Secondary.Text;
            clientperson.Marital_Status = ddl_Marital_Status.SelectedValue.ToString();
            clientperson.Citizenship = ddl_CitizenShip.SelectedValue.ToString();
            Set_Visa_Type();
            if (TxtVisaIssDate.Text != "")
            {
                clientperson.Visa_Issue_Date = Convert.ToDateTime(TxtVisaIssDate.Text.ToString());
            }
            if (TxtVisaExpDate.Text != "")
            {
                clientperson.Visa_Expire_Date = Convert.ToDateTime(TxtVisaExpDate.Text.ToString());
            }
            if (TxtUSCISNum.Text != "")
            {
                clientperson.Perm_Resident_Alien_USCIS_number = Convert.ToInt32(TxtUSCISNum.Text);
            }
            if (TxtANumber.Text != "")
            {
                clientperson.Perm_Resident_Alien_A_number = Convert.ToInt32(TxtANumber.Text);
            }
            if (TxtresDate.Text != "")
            {
                clientperson.Perm_Resident_Alien_Resid_Date = Convert.ToDateTime(TxtresDate.Text);
            }
            if (TxtResExpDate.Text != "")
            {
                clientperson.Perm_Resident_Alien_Expire_Date = Convert.ToDateTime(TxtResExpDate.Text);
            }
            clientperson.Perm_Resident_Alien_Birth_Country = TxtCountryOfBirth.Text;
            clientperson.Perm_Resident_Alien_Category = TxtCategory.Text;

            clientAddress.address_type_id = 2;
            clientAddress.str_add = txtCurr_str_addr.Text;
            clientAddress.str_add2 = TxtCurr_str_addr2.Text;
            clientAddress.city = txtCurr_city.Text;
            clientAddress.state = ddlCurr_st.SelectedValue;
            clientAddress.zip_plus_four = txtCurr_zip.Text;
            clientAddress.country = TxtCurr_Country.Text;
            clientAddress.County_Township = TxtCurr_CountyTownship.Text;

            add1cord = GeoLocation.getCoordinates(clientAddress.str_add, clientAddress.str_add2, clientAddress.city, clientAddress.state, clientAddress.zip_plus_four, "DMCS");

            clientAddress.latitude = add1cord[0];
            clientAddress.longitude = add1cord[1];

            client.client_status = ddl_client_status.SelectedValue;

            if (clientAddress.address_id == 0)
            {
                clientAddress = clientAddress.Insert(clientAddress);
                clientperson.address_id = clientAddress.address_id;
            }
            else
            {
                clientAddress.Update(clientAddress);
            }

            if (txtPrev_city.Text != "" && TxtPrev_Country.Text != "" &&
               ddlPrev_st.SelectedValue != "" && txtPrev_str_addr.Text != "")
            {
                clientAddress2.address_type_id = 3;
                clientAddress2.str_add = txtPrev_str_addr.Text;
                clientAddress2.str_add2 = txtPrev_str_addr2.Text;
                clientAddress2.city = txtPrev_city.Text;
                clientAddress2.state = ddlPrev_st.SelectedValue;
                clientAddress2.zip_plus_four = txtPrev_zip.Text;
                clientAddress2.str_add2 = txtPrev_str_addr2.Text;
                clientAddress2.country = TxtPrev_Country.Text;
                clientAddress2.County_Township = TxtPrev_countyTownship.Text;

                add2cord = GeoLocation.getCoordinates(clientAddress2.str_add, clientAddress2.str_add2, clientAddress2.city, clientAddress2.state, clientAddress2.zip_plus_four, "DMCS");

                clientAddress2.latitude = add2cord[0];
                clientAddress2.longitude = add2cord[1];

                if (clientAddress2.address_id == 0)
                {
                    clientAddress2 = clientAddress2.Insert(clientAddress2);
                    clientperson.address_id2 = clientAddress2.address_id;
                }
                else
                {
                    clientAddress2.Update(clientAddress2);
                }

            }

            if (clientperson.person_id == 0)
            {
                clientperson = clientperson.Insert(clientperson);
            }
            else
            {
                clientperson.Update(clientperson);
            }

            if (client.client_id == 0)
            {
                client.client_id = clientperson.person_id;
                client = client.Insert(client);
            }
            else
            {
                client.Update(client);
            }
        }
        protected void fill_Client_information()
        {
            client = client.Select(GlobalVariables.PersonID);
            GlobalVariables.ClientID = client.client_id;

            clientAddress = clientAddress.Select(clientperson.address_id);
            clientAddress2 = clientAddress2.Select(clientperson.address_id2);

            GlobalVariables.ClientAddressID = clientAddress.address_id;
            GlobalVariables.ClientAddressID2 = clientAddress2.address_id;

            ddl_client_status.SelectedValue = client.client_status;
            txt_L_Name.Text = clientperson.l_name.ToString();
            txt_F_Name.Text = clientperson.f_name.ToString();
            txt_M_Initial.Text = clientperson.m_initial.ToString();
            txt_email.Text = clientperson.email.ToString();
            txt_Maiden_Name.Text = clientperson.Maiden_Name.ToString();
            ddl_Gender.SelectedValue = clientperson.gender;
            txt_SSN.Text = clientperson.ssn.ToString();
            txt_DrvLic.Text = clientperson.Driver_State_ID;
            txt_Birthdate.Text = clientperson.birthdate.ToString();
            txt_Phone_Primary.Text = clientperson.phone_primary;
            txt_Phone_Secondary.Text = clientperson.phone_secondary;
            ddl_Marital_Status.SelectedValue = clientperson.Marital_Status;
            ddl_CitizenShip.SelectedValue = clientperson.Citizenship;

            get_visa_type();

            TxtVisaIssDate.Text = clientperson.Visa_Issue_Date.ToString();
            TxtVisaExpDate.Text = clientperson.Visa_Expire_Date.ToString();
            TxtUSCISNum.Text = clientperson.Perm_Resident_Alien_USCIS_number.ToString();
            TxtANumber.Text = clientperson.Perm_Resident_Alien_A_number.ToString();
            TxtresDate.Text = clientperson.Perm_Resident_Alien_Resid_Date.ToString();
            TxtResExpDate.Text = clientperson.Perm_Resident_Alien_Expire_Date.ToString();
            TxtCountryOfBirth.Text = clientperson.Perm_Resident_Alien_Birth_Country;
            TxtCategory.Text = clientperson.Perm_Resident_Alien_Category;

            txtCurr_str_addr.Text = clientAddress.str_add;
            TxtCurr_str_addr2.Text = clientAddress.str_add2;
            txtCurr_city.Text = clientAddress.city;
            if (clientAddress.state != null)
            {
                ddlCurr_st.SelectedValue = clientAddress.state;
            }
            txtCurr_zip.Text = clientAddress.zip_plus_four.ToString();
            TxtCurr_Country.Text = clientAddress.country;
            TxtCurr_CountyTownship.Text = clientAddress.County_Township;

            txtPrev_str_addr.Text = clientAddress2.str_add;
            txtPrev_str_addr2.Text = clientAddress2.str_add2;
            txtPrev_city.Text = clientAddress2.city;
            if (clientAddress2.state != "")
            {
                ddlPrev_st.SelectedValue = clientAddress2.state;
            }
            txtPrev_zip.Text = clientAddress2.zip_plus_four.ToString();
            TxtPrev_Country.Text = clientAddress2.country;
            TxtPrev_countyTownship.Text = clientAddress2.County_Township;
        }
Exemple #17
0
 private static bool HasSameName(address c, Contact f)
 {
     return(c.name == f.Firstname + " " + f.Surname);
 }
Exemple #18
0
        public ActionResult Add(FormCollection form, int id, String msg = null)
        {
            ViewBag.m = msg;
            List <SelectListItem> CustomerInfo = new List <SelectListItem>();

            CustomerInfo.AddRange(db.customers.Where(x => x.deleted != true).Select(a => new SelectListItem
            {
                Text     = a.customer_lastname,
                Selected = false,
                Value    = a.customer_number.ToString()
            }));

            var ClassInfo = new List <SelectListItem>();

            ClassInfo.AddRange(db.project_class.Where(x => x.deleted != true).Select(LLL => new SelectListItem
            {
                Text     = LLL.class_name,
                Selected = false,
                Value    = LLL.class_number.ToString()
            }));

            var StatusInfo = new List <SelectListItem>();

            StatusInfo.AddRange(db.project_status.Where(x => x.deleted != true).Select(c => new SelectListItem
            {
                Text     = c.project_status_name,
                Selected = false,
                Value    = c.project_status_number.ToString()
            }));

            var ProjectTypeInfo = new List <SelectListItem>();

            ProjectTypeInfo.AddRange(db.project_type.Where(x => x.deleted != true).Select(VVVb => new SelectListItem
            {
                Text     = VVVb.project_type_name,
                Selected = false,
                Value    = VVVb.project_type_number.ToString()
            }));

            var SourceInfo = new List <SelectListItem>();

            SourceInfo.AddRange(db.lead_source.Where(x => x.deleted != true).Select(ffb => new SelectListItem
            {
                Text     = ffb.source_name,
                Selected = false,
                Value    = ffb.source_number.ToString()
            }));

            var AddressInfo = new List <SelectListItem>();

            AddressInfo.AddRange(db.addresses.Where(x => x.deleted != true).Select(a => new SelectListItem
            {
                Text     = a.address_type,
                Selected = false,
                Value    = a.address_number.ToString()
            }));

            var AddressCityInfo = new List <SelectListItem>();

            var EmpInfo = new List <SelectListItem>();

            EmpInfo.AddRange(db.employees.Where(x => x.deleted != true).Select(a => new SelectListItem
            {
                Text     = a.emp_firstname + " " + a.emp_lastname,
                Selected = false,
                Value    = a.emp_number.ToString()
            }));

            var BranchInfo = new List <SelectListItem>();

            BranchInfo.AddRange(db.branches.Where(x => x.deleted != true).Select(a => new SelectListItem
            {
                Text     = a.branch_name,
                Selected = false,
                Value    = a.branch_number.ToString()
            }));

            var DeliveryStatusInfo = new List <SelectListItem>();

            DeliveryStatusInfo.AddRange(db.delivery_status.Select(a => new SelectListItem
            {
                Text     = a.delivery_status_name,
                Selected = false,
                Value    = a.delivery_status_number.ToString()
            }));


            var TaxExemptInfo = new List <SelectListItem> {
                new SelectListItem()
                {
                    Text = "Taxable", Value = "0"
                },
                new SelectListItem {
                    Text = "Tax Exempt", Value = "1"
                }
            };

            ViewBag.TaxExemptInfo = TaxExemptInfo;

            //setting variable passing
            ViewBag.Customer_Info       = CustomerInfo;
            ViewBag.Class_Info          = ClassInfo;
            ViewBag.Status_Info         = StatusInfo;
            ViewBag.ProjectType_Info    = ProjectTypeInfo;
            ViewBag.Source_Info         = SourceInfo;
            ViewBag.Address_Info        = AddressInfo;
            ViewBag.Emp_Info            = EmpInfo;
            ViewBag.Branch_Info         = BranchInfo;
            ViewBag.DeliveryStatus_Info = DeliveryStatusInfo;



            var Sstate = new List <SelectListItem> {
                new SelectListItem()
                {
                    Text = "Alabama", Value = "AL"
                },
                new SelectListItem()
                {
                    Text = "Alaska", Value = "AK"
                },
                new SelectListItem()
                {
                    Text = "Arizona", Value = "AZ"
                },
                new SelectListItem()
                {
                    Text = "Arkansas", Value = "AR"
                },
                new SelectListItem()
                {
                    Text = "California", Value = "CA"
                },
                new SelectListItem()
                {
                    Text = "Colorado", Value = "CO"
                },
                new SelectListItem()
                {
                    Text = "Connecticut", Value = "CT"
                },
                new SelectListItem()
                {
                    Text = "District of Columbia", Value = "DC"
                },
                new SelectListItem()
                {
                    Text = "Delaware", Value = "DE"
                },
                new SelectListItem()
                {
                    Text = "Florida", Value = "FL"
                },
                new SelectListItem()
                {
                    Text = "Georgia", Value = "GA"
                },
                new SelectListItem()
                {
                    Text = "Hawaii", Value = "HI"
                },
                new SelectListItem()
                {
                    Text = "Idaho", Value = "ID"
                },
                new SelectListItem()
                {
                    Text = "Illinois", Value = "IL"
                },
                new SelectListItem()
                {
                    Text = "Indiana", Value = "IN"
                },
                new SelectListItem()
                {
                    Text = "Iowa", Value = "IA"
                },
                new SelectListItem()
                {
                    Text = "Kansas", Value = "KS"
                },
                new SelectListItem()
                {
                    Text = "Kentucky", Value = "KY"
                },
                new SelectListItem()
                {
                    Text = "Louisiana", Value = "LA"
                },
                new SelectListItem()
                {
                    Text = "Maine", Value = "ME"
                },
                new SelectListItem()
                {
                    Text = "Maryland", Value = "MD"
                },
                new SelectListItem()
                {
                    Text = "Massachusetts", Value = "MA"
                },
                new SelectListItem()
                {
                    Text = "Michigan", Value = "MI"
                },
                new SelectListItem()
                {
                    Text = "Minnesota", Value = "MN"
                },
                new SelectListItem()
                {
                    Text = "Mississippi", Value = "MS"
                },
                new SelectListItem()
                {
                    Text = "Missouri", Value = "MO"
                },
                new SelectListItem()
                {
                    Text = "Montana", Value = "MT"
                },
                new SelectListItem()
                {
                    Text = "Nebraska", Value = "NE"
                },
                new SelectListItem()
                {
                    Text = "Nevada", Value = "NV"
                },
                new SelectListItem()
                {
                    Text = "New Hampshire", Value = "NH"
                },
                new SelectListItem()
                {
                    Text = "New Jersey", Value = "NJ"
                },
                new SelectListItem()
                {
                    Text = "New Mexico", Value = "NM"
                },
                new SelectListItem()
                {
                    Text = "New York", Value = "NY"
                },
                new SelectListItem()
                {
                    Text = "North Carolina", Value = "NC"
                },
                new SelectListItem()
                {
                    Text = "North Dakota", Value = "ND"
                },
                new SelectListItem()
                {
                    Text = "Ohio", Value = "OH"
                },
                new SelectListItem()
                {
                    Text = "Oklahoma", Value = "OK"
                },
                new SelectListItem()
                {
                    Text = "Oregon", Value = "OR"
                },
                new SelectListItem()
                {
                    Text = "Pennsylvania", Value = "PA"
                },
                new SelectListItem()
                {
                    Text = "Rhode Island", Value = "RI"
                },
                new SelectListItem()
                {
                    Text = "South Carolina", Value = "SC"
                },
                new SelectListItem()
                {
                    Text = "South Dakota", Value = "SD"
                },
                new SelectListItem()
                {
                    Text = "Tennessee", Value = "TN"
                },
                new SelectListItem()
                {
                    Text = "Texas", Value = "TX"
                },
                new SelectListItem()
                {
                    Text = "Utah", Value = "UT"
                },
                new SelectListItem()
                {
                    Text = "Vermont", Value = "VT"
                },
                new SelectListItem()
                {
                    Text = "Virginia", Value = "VA"
                },
                new SelectListItem()
                {
                    Text = "Washington", Value = "WA"
                },
                new SelectListItem()
                {
                    Text = "West Virginia", Value = "WV"
                },
                new SelectListItem()
                {
                    Text = "Wisconsin", Value = "WI"
                },
                new SelectListItem()
                {
                    Text = "Wyoming", Value = "WY"
                }
            };

            ViewBag.Sstate = Sstate;


            try
            {
                lead target = new lead();
                {
                    target.customer = db.customers.Where(aa => aa.customer_number == id).FirstOrDefault();
                    int a = Int32.Parse(form["class_number"]);
                    target.project_class = db.project_class.Where(KL => KL.class_number == a).FirstOrDefault();
                    int c = Int32.Parse(form["project_type_number"]);
                    target.project_type = db.project_type.Where(GH => GH.project_type_number == c).FirstOrDefault();
                    int dd = Int32.Parse(form["source_number"]);
                    target.lead_source = db.lead_source.Where(TY => TY.source_number == dd).FirstOrDefault();
                    int ee = Int32.Parse(form["source_number"]);
                    target.lead_source = db.lead_source.Where(qq => qq.source_number == ee).FirstOrDefault();
                    int ff = Int32.Parse(form["emp_number"]);
                    target.employee = db.employees.Where(ww => ww.emp_number == ff).FirstOrDefault();
                    int gg = Int32.Parse(form["branch_number"]);
                    target.branch = db.branches.Where(ss => ss.branch_number == gg).FirstOrDefault();
                    int hh = Int32.Parse(form["delivery_status_number"]);
                    target.delivery_status = db.delivery_status.Where(xx => xx.delivery_status_number == hh).FirstOrDefault();


                    target.in_city = Convert.ToBoolean(form["Item1.in_city"].Split(',')[0]);
                    string aaa = form["Item1.in_city"];
                    // target.tax_exempt = Convert.ToBoolean(form["Item1.tax_exempt"].Split(',')[0]);
                    target.tax_exempt          = string.Equals(form["tax_exempt"], "1")?true:false;
                    target.project_name        = form["Item1.project_name"];
                    target.phone_number        = form["Item1.phone_number"];
                    target.second_phone_number = form["Item1.second_phone_number"];
                    target.email        = form["Item1.email"];
                    target.lead_creator = User.Identity.GetUserName();
                    target.note         = form["Item1.note"];

                    target.deleted = false;
                    //   target.address_number = b.address_number;
                    target.project_status_number = 3;
                    target.lead_date             = System.DateTime.Now;
                    target.Last_update_date      = System.DateTime.Now;
                };
                db.leads.Add(target);
                db.SaveChanges();

                address b = new address
                {
                    address1     = form["Item2.address1"],
                    address_type = "JobAddress",
                    city         = form["Item2.city"],
                    //  state = form["state"],
                    state       = form["state1"],
                    county      = form["Item2.county"],
                    zipcode     = form["Item2.zipcode"],
                    deleted     = false,
                    lead_number = target.lead_number
                };
                db.addresses.Add(b);
                db.SaveChanges();
                if (string.IsNullOrEmpty(form["Item3.address1"]))
                {
                }
                else
                {
                    address BC = new address
                    {
                        address1 = form["Item3.address1"],
                        //     address_type = form["Item2.address_type"],
                        address_type = "alternativeAddress",
                        city         = form["Item3.city"],
                        state        = form["state2"],
                        // state = form["state"],

                        //   state = "Not fixed yet",
                        county      = form["Item3.county"],
                        zipcode     = form["Item3.zipcode"],
                        deleted     = false,
                        lead_number = target.lead_number
                    };
                    db.addresses.Add(BC);
                    db.SaveChanges();
                }


                ViewBag.m = " The lead was successfully created to " + target.customer.customer_firstname + " " + target.customer.customer_lastname + " on " + System.DateTime.Now;


                return(RedirectToAction("Edit/" + target.lead_number, "lead", new { msg = ViewBag.m }));
            }
            catch (Exception e)
            {
                ViewBag.m = "The lead was not created ..." + e.Message;
                return(View());
            }
        }
Exemple #19
0
 public ApiMessage <bool> Save(address model)
 {
     model.UserID     = UserInfo.Id;
     model.CreateDate = DateTime.Now;
     return(bll.Save(model));
 }
 public static void InsertAddress(address insertadd)
 {
     DAL.InsertAddress(insertadd);
 }
Exemple #21
0
        public MeetTest(int testId, string teacherId, string studentId, DateTime time, address testAddress, bool distanceKeeping, bool reverseParking, bool lookingAtMirrors, bool signaling, int testGrade, string testersNote)
        {
            this.TestId           = testId;
            this.TeacherId        = teacherId;
            this.StudentId        = studentId;
            this.Time             = time;
            this.TestAddress      = testAddress;
            this.DistanceKeeping  = distanceKeeping;
            this.ReverseParking   = reverseParking;
            this.LookingAtMirrors = lookingAtMirrors;
            this.Signaling        = signaling;
            this.TestGrade        = testGrade;
            this.TestersNote      = testersNote;

            group = new List <string>();
            //
        }
Exemple #22
0
        public void replaceAddress(address addr)
        {
            string str = str = "replace into all_address (name, lat, lon) values ('" + addr.name + "', " + addr.pos.Lat + ", " + addr.pos.Lng + ")";

            excuteCommand(str);
        }
Exemple #23
0
 public void insert(address newItem)
 {
     db.addresses.Add(newItem);
     db.SaveChanges();
 }
Exemple #24
0
        public address selectSingle(address findItem)
        {
            address selectedItem = db.addresses.SingleOrDefault(item => item.id == findItem.id);

            return(selectedItem);
        }
Exemple #25
0
 private static bool HasSameICO(address c, Contact f)
 {
     return(c.ico is string && ((string)c.ico).Length > 0 && ((string)c.ico) == f.IdentificationNumber);
 }
        protected void createInvoicePreview()
        {
            //create invoice preview

            final_invoice_div.Style.Add("display", "block");

            FINAL_to_Name_L.Text = selected_Warehouse.warehouse_name;
            FINAL_to_CompanyName_L.Text = selected_Warehouse.warehouse_name;
            FINAL_to_StreetAddress_L.Text = address.str_add;
            FINAL_to_CityStateZip_L.Text = address.city + " " + address.state + " " + address.zip_plus_four;

            FINAL_caseNumber_L.Text = "Case #/Order #: " + case_intake.case_id + " / " + requestor_Order.OrderID;
            FINAL_date_L.Text = Convert.ToString(DateTime.Now);

            for (int i = 0; i < product_id_array.Length; i++)
            {
                products = products.Select(Convert.ToInt32(product_id_array[i]));
                warehouse_product_location = warehouse_product_location.Select_By_Product_ID(products.product_id);
                warehouse = warehouse.Select(warehouse_product_location.warehouse_id);
                checkWarehouseIDs.Add(warehouse.warehouse_id);
                for (int j = 0; j < checkWarehouseIDs.Count; j++)
                {
                    if (warehouse.warehouse_id != checkWarehouseIDs[j] || checkWarehouseIDs.Count == 1)
                    {
                        selectedWarehouseIDs.Add(warehouse.warehouse_id);
                    }
                }

                int itemNum = i + 1;
                FINAL_orderNum_div.InnerHtml += itemNum + "<br/>";
                FINAL_ProductID_and_WarehouseID_div.InnerHtml += products.product_id + " / " + warehouse.warehouse_id + "<br/>";
                FINAL_orderQTY_div.InnerHtml += 1 + "<br/>";
                FINAL_orderDESCRIPTION_div.InnerHtml += products.product_name + "<br/>";

            }
            FINAL_from_Name_L.Text = "";
            FINAL_from_CompanyName_L.Text = "";
            FINAL_from_StreetAddress_L.Text = "";
            FINAL_from_CityStateZip_L.Text = "";
            for (int k = 0; k < selectedWarehouseIDs.Count; k++)
            {
                warehouse = warehouse.Select(selectedWarehouseIDs[k]);
                address = address.Select(warehouse.address_id);
                if (selectedWarehouseIDs[k] == selectedWarehouseIDs.Count - 1 && selectedWarehouseIDs.Count > 0)
                {
                    FINAL_from_Name_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name + " | ";
                    FINAL_from_CompanyName_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name + " | ";
                    FINAL_from_StreetAddress_L.Text += selectedWarehouseIDs[k] + ": " + address.str_add + " | ";
                    FINAL_from_CityStateZip_L.Text += selectedWarehouseIDs[k] + ": " + address.city + " " + address.state + " " + address.zip_plus_four + " | ";
                }
                else if (selectedWarehouseIDs[k] != selectedWarehouseIDs.Count - 1 && selectedWarehouseIDs.Count > 0)
                {
                    FINAL_from_Name_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name;
                    FINAL_from_CompanyName_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name;
                    FINAL_from_StreetAddress_L.Text += selectedWarehouseIDs[k] + ": " + address.str_add;
                    FINAL_from_CityStateZip_L.Text += selectedWarehouseIDs[k] + ": " + address.city + " " + address.state + " " + address.zip_plus_four;
                }
                else
                {
                    FINAL_from_Name_L.Text += warehouse.warehouse_name;
                    FINAL_from_CompanyName_L.Text += warehouse.warehouse_name;
                    FINAL_from_StreetAddress_L.Text += address.str_add;
                    FINAL_from_CityStateZip_L.Text += address.city + " " + address.state + " " + address.zip_plus_four;
                }
            }
            placeOrder_div.Style.Add("display", "none");
        }
Exemple #27
0
 set => Write(address, value);
Exemple #28
0
 set => write(address, value);
Exemple #29
0
 private Contact MatchContact(address c)
 {
     return(_prefetchedContacts.FirstOrDefault(f => HasSameICO(c, f) || HasSameName(c, f)));
 }
        //select a client and display data
        protected void Update_gvClientSearchresult_SelectedIndexChanged(object sender, EventArgs e)
        {
            person = person.Select(Convert.ToInt32(Update_gvClientSearchresult.SelectedDataKey.Value));
            GlobalVariables.PersonID = Convert.ToInt32(Update_gvClientSearchresult.SelectedDataKey.Value);

            address = address.Select(person.address_id);
            missing = missing.Select(person.person_id);
            deceased = deceased.Select(person.person_id);

            client = client.Select(person.person_id);
            GlobalVariables.ClientID = client.client_id;

            Update_LocationDiscription_txt.Text = missing.last_known_location;
            Update_reason_of_death_txt.Text = deceased.reason_of_death;
            Update_time_of_death_txt.Text = Convert.ToString(deceased.time_of_death);
            Update_identifying_marks_txt.Text = deceased.identifying_marks;
            Update_external_exam_txt.Text = deceased.external_exam;
            Update_date_of_autopsy_txt.Text = Convert.ToString(deceased.date_of_autopsy.ToShortDateString());
            Update_internal_exam_txt.Text = deceased.external_exam;
            Update_client_other_info_txt.Text = missing.client_other_info;
            Update_Client_latitude_txt.Text = Convert.ToString(address.latitude);
            Update_Client_longitude_txt.Text = Convert.ToString(address.longitude);
            Update_Client_zip_plus_four_txt.Text = Convert.ToString(address.zip_plus_four);
            Update_Client_str_add2_txt.Text = address.str_add;
            Update_Client_str_add_txt.Text = address.str_add2;
            Update_Client_County_Township_txt.Text = address.County_Township;
            Update_Client_country_txt.Text = address.country;
            Update_Client_state_txt.Text = address.state;
            Update_Client_city_txt.Text = address.city;
            Update_hair_color_ddl.SelectedValue = client.hair_color;
            Update_skin_color_ddl.SelectedValue = client.skin_color;
            Update_eye_color_ddl.SelectedValue = client.eye_color;
            Update_ethnicity_txt.Text = client.ethnicity;
            Update_weight_txt.Text = Convert.ToString(client.weight);
            Update_height_ddl.SelectedValue = Convert.ToString(client.height);
            Update_date_of_disappearance_txt.Text = Convert.ToString(missing.date_of_disappearance.ToShortDateString());
            Update_clothing_txt.Text = missing.clothing;
            Update_phone_primary_txt.Text = person.phone_primary;
            Update_ssn_txt.Text = Convert.ToString(person.ssn);
            Update_gender_ddl.SelectedValue = person.gender;
            Update_l_name_txt.Text = person.l_name;
            Update_m_initial_txt.Text = person.m_initial;
            Update_f_name_txt.Text = person.f_name;

            //change condishions
            Update_txtFirstName.Text = person.f_name.ToString();
            Update_txtLastName.Text = person.l_name.ToString();

            if (client.client_status == "D")
            {
                Update_Deceased_Div.Style.Add("display", "block");
                Update_deceasedYes.Checked = true;
                Update_missingYes.Checked = false;
            }
            else
            {
                Update_Deceased_Div.Style.Add("display", "none");
                Update_deceasedYes.Checked = false;
                Update_missingYes.Checked = true;
            }

            Update_sClient_L.Text = "</br>" + person.f_name + " " + person.l_name + " is selected.";
        }
Exemple #31
0
 public Teacher(string id, string firstName, string lastName, DateTime birthDay, address adress, string phoneNumber, int maxHoursPerWeek, int maxKMFromHome, Schedule hours, typecar carTypeSpecialization, gearbox gear, int seniorityYears, Gender gender)
 {
     Id                         = id;
     FirstName                  = firstName;
     LastName                   = lastName;
     BirthDay                   = birthDay;
     Adress                     = adress;
     PhoneNumber                = phoneNumber;
     this.maxHoursPerWeek       = maxHoursPerWeek;
     this.maxKMFromHome         = maxKMFromHome;
     Hours                      = hours;
     this.carTypeSpecialization = carTypeSpecialization;
     Gear                       = gear;
     SeniorityYears             = seniorityYears;
     this.gender                = gender;
     Hours                      = new Schedule();
     group                      = new List <string>();
 }
Exemple #32
0
 /// <summary>
 /// Primary constructor for the query_sm PDU
 /// </summary>
 /// <param name="msgid">Message ID of the message whose state is being queried.</param>
 /// <param name="saddr">Source Address of the original request</param>
 public query_sm(string msgid, address saddr)
     : this()
 {
     this.MessageID     = msgid;
     this.SourceAddress = saddr;
 }
Exemple #33
0
 /// <summary>
 /// Primary constructor for the list_dls PDU
 /// </summary>
 /// <param name="source">ESME source address</param>
 public list_dls(address source)
     : this()
 {
     this.Address = source;
 }
        private void cbAddress_SelectedIndexChanged(object sender, EventArgs e)
        {
            address a = (address)cbAddress.SelectedItem;

            filter.address = a.addressId;
        }
Exemple #35
0
 /// <summary>
 /// 插入方法
 /// </summary>
 /// <param name="address">address表实例</param>
 /// <returns>int</returns>
 public int Insert(address addressExample)
 {
     sqlstr = "insert into  address (aAddress,aCity,aDistrict,aid,aPostNumber,aProvince,aremark,astate)values(@aAddress,@aCity,@aDistrict,@aid,@aPostNumber,@aProvince,@aremark,@astate)";
     return(ExecuteNonQuery(GetOleDbParameter(addressExample)));
 }
Exemple #36
0
 /// <summary>
 /// The set regulatory.
 /// </summary>
 /// <param name="address">
 /// The address.
 /// </param>
 /// <param name="regulatoryAddress">
 /// The regulatory address.
 /// </param>
 public static void SetRegulatory(this address address, IAddress regulatoryAddress)
 {
     address.RegulatoryId = regulatoryAddress.Id;
 }
Exemple #37
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="address">address表实例</param>
 /// <returns>int</returns>
 public int Update(address addressExample)
 {
     sqlstr = "update address set aAddress=@aAddress,aCity=@aCity,aDistrict=@aDistrict,aPostNumber=@aPostNumber,aProvince=@aProvince,aremark=@aremark,astate=@astate where aid=" + addressExample.aid;
     return(ExecuteNonQuery(GetOleDbParameter(addressExample)));
 }
        protected void Save_Employer_info()
        {
            decimal[] emplradd = new decimal[2];

            clientEmplrAddress.address_id = GlobalVariables.EmplrAddressID;
            clientemployer.emplr_id = GlobalVariables.EmployerID;

            clientEmplrAddress.address_type_id = 2;
            clientEmplrAddress.str_add = txtempr_str_addr.Text;
            clientEmplrAddress.str_add2 = Txtempr_str_addr2.Text;
            clientEmplrAddress.city = txtempr_city.Text;
            clientEmplrAddress.state = ddlempr_st.SelectedValue;
            clientEmplrAddress.zip_plus_four = txtempr_zip.Text;
            clientEmplrAddress.country = TxtEmpr_Country.Text;
            clientEmplrAddress.County_Township = Txtempr_CountyTownship.Text;

            emplradd = GeoLocation.getCoordinates(clientEmplrAddress.str_add, clientEmplrAddress.str_add2, clientEmplrAddress.city, clientEmplrAddress.state, clientEmplrAddress.zip_plus_four, "DMCS");

            clientEmplrAddress.latitude = emplradd[0];
            clientEmplrAddress.longitude = emplradd[1];

            if (clientEmplrAddress.address_id == 0)
            {
                clientEmplrAddress = clientEmplrAddress.Insert(clientEmplrAddress);
            }
            else
            {
                clientEmplrAddress.Update(clientEmplrAddress);
            }

            clientemployer.address_id = clientEmplrAddress.address_id;
            clientemployer.case_id = clientCase_intake.case_id;
            clientemployer.client_id = client.client_id;
            clientemployer.emplr_name = TxtEmplr_Name.Text;
            clientemployer.emplr_phone = TxtEmplr_Phone.Text;
            if (TxtEmpSrtDate.Text != "")
            {
                clientemployer.strt_date = Convert.ToDateTime(TxtEmpSrtDate.Text);
            }

            if (TxtEmpEndDate.Text != "")
            {
                clientemployer.end_date = Convert.ToDateTime(TxtEmpEndDate.Text);
            }
            else
            {
                clientemployer.end_date = Convert.ToDateTime("9/9/9999");
            }

            clientemployer.term_reason = TxtTermReas.Text;

            if (clientemployer.emplr_id == 0)
            {
                clientemployer = clientemployer.Insert(clientemployer);
            }
            else
            {
                clientemployer.Update(clientemployer);
            }
        }
Exemple #39
0
        /// <summary>
        /// 根据表,获取一个OleDbParameter数组
        /// </summary>
        /// <returns>OleDbParameter[]</returns>
        public static OleDbParameter[] GetOleDbParameter(address addressExample)
        {
            List <OleDbParameter> list_param = new List <OleDbParameter>();

            if (!string.IsNullOrEmpty(addressExample.aAddress))
            {
                list_param.Add(new OleDbParameter("@aAddress", addressExample.aAddress));
            }
            else
            {
                list_param.Add(new OleDbParameter("@aAddress", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(addressExample.aCity))
            {
                list_param.Add(new OleDbParameter("@aCity", addressExample.aCity));
            }
            else
            {
                list_param.Add(new OleDbParameter("@aCity", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(addressExample.aDistrict))
            {
                list_param.Add(new OleDbParameter("@aDistrict", addressExample.aDistrict));
            }
            else
            {
                list_param.Add(new OleDbParameter("@aDistrict", DBNull.Value));
            }
            if (!string.IsNullOrEmpty(addressExample.aPostNumber))
            {
                list_param.Add(new OleDbParameter("@aPostNumber", addressExample.aPostNumber));
            }
            else
            {
                list_param.Add(new OleDbParameter("@aPostNumber", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(addressExample.aProvince))
            {
                list_param.Add(new OleDbParameter("@aProvince", addressExample.aProvince));
            }
            else
            {
                list_param.Add(new OleDbParameter("@aProvince", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(addressExample.aremark))
            {
                list_param.Add(new OleDbParameter("@aremark", addressExample.aremark));
            }
            else
            {
                list_param.Add(new OleDbParameter("@aremark", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(addressExample.astate))
            {
                list_param.Add(new OleDbParameter("@astate", addressExample.astate));
            }
            else
            {
                list_param.Add(new OleDbParameter("@astate", DBNull.Value));
            }
            OleDbParameter[] param = new OleDbParameter[list_param.Count];
            int index = 0;

            foreach (OleDbParameter p in list_param)
            {
                param[index] = p;
                index++;
            }
            return(param);
        }
        protected void fill_employer_info()
        {
            String whereclause = "Client_id = " + clientcase.client_id + " and Case_Id = " + clientcase.case_id;

            DataTable dt = clientemployer.Select(whereclause);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                TxtEmplr_Name.Text = dr.Field<String>(4);
                TxtEmplr_Phone.Text = dr.Field<String>(5);
                TxtEmpSrtDate.Text = Convert.ToString(dr.Field<DateTime>(7));
                TxtEmpEndDate.Text = Convert.ToString(dr.Field<DateTime>(6));
                TxtTermReas.Text = dr.Field<String>(8);

                clientEmplrAddress = clientEmplrAddress.Select(dr.Field<int>(3));
                GlobalVariables.EmplrAddressID = dr.Field<int>(3);
                GlobalVariables.EmployerID = dr.Field<int>(0);

                if (clientEmplrAddress.address_id != 0)
                {
                    txtempr_str_addr.Text = clientEmplrAddress.str_add;
                    Txtempr_str_addr2.Text = clientEmplrAddress.str_add2;
                    txtempr_city.Text = clientEmplrAddress.city;
                    ddlempr_st.SelectedValue = clientEmplrAddress.state;
                    txtempr_zip.Text = clientEmplrAddress.zip_plus_four.ToString();
                    TxtEmpr_Country.Text = clientEmplrAddress.country;
                    Txtempr_CountyTownship.Text = clientEmplrAddress.County_Township;
                }
            }
        }
        public ActionResult Edit([Bind(Include = "Venue_ID,Venue_Name,Venue_Description,Venue_Size,Address_ID")] venue venue, address address)
        {
            bool val = db.venues.Any(s => s.Venue_Name == venue.Venue_Name && s.Venue_ID != venue.Venue_ID);


            if (val == false)
            {
                //address.Address_ID = venue.Address_ID;
                db.Entry(address).State = EntityState.Modified;

                db.Entry(venue).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else if (val == true)
            {
                ViewBag.StatusMessage = "There is already a venue called: " + venue.Venue_Name + "  in the database.";

                ViewBag.Address_ID = new SelectList(db.addresses, "Address_ID", "Street_Name", venue.Address_ID);
                return(View());
            }
            ViewBag.Address_ID = new SelectList(db.addresses, "Address_ID", "Street_Name", venue.Address_ID);
            return(View(venue));
        }
        private void btnSearchCNPJ_Click(object sender, EventArgs e)
        {
            if (!validatorCNPJ.Validate())
                return;
            try
            {
                //validações
                var countcnpj = credentialed.repo.ExecuteScalar<string>("SELECT COUNT(id) FROM credentialeds WHERE cnpj=@0",
                    tfCNPJ.EditValue);
                if (!countcnpj.Equals(DBNull.Value) && !String.IsNullOrEmpty(countcnpj))
                {
                    if (Convert.ToInt32(countcnpj) >= 1)
                    {
                        DialogResult rs = XtraMessageBox.Show("CNPJ já consta cadastrado, deseja carregar os dados?",
                            "Cadore Tecnologia", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                        if (rs == DialogResult.No)
                            return;
                        credentialed cre = credentialed.SingleOrDefault("WHERE cnpj=@0", tfCNPJ.EditValue);
                        bdgAddress.DataSource = address.SingleOrDefault(cre.address_id);
                        bdgCredentialed.DataSource = cre;
                        peLogo.Image = new FTPUtil().getImageFromFile(cre.directory_logo);
                        pCNPJ.Enabled = false;
                        pData.Enabled = true;
                        IsNew = false;
                        return;
                    }
                }
                SearchCPFCNPJUtil cc = new SearchCPFCNPJUtil();
                if (cc.Search(Document.CNPJ, tfCNPJ.Text))
                {
                    credentialed cre = new credentialed() { registered_at = null, inactived_at = null };
                    address d = new address();

                    cre.cnpj = cc.NCNPJ;
                    cre.company_name = cc.RAZAOSOCIAL;
                    cre.fantasy_name = cc.FANTASIA;
                    cre.opening_at = Convert.ToDateTime(cc.ABERTURA);
                    d.name = cc.ENDERECO;
                    d.number = cc.NUMERO;
                    d.complement = cc.COMPLEMENTO;
                    d.district = cc.BAIRRO;
                    d.cep = cc.CEP;
                    state st = state.SingleOrDefault("WHERE symbol=@0", cc.UF);
                    d.state_id = st != null ? st.id : 0;
                    List<city> lci = city.Fetch("WHERE name ILIKE @0 AND state_id=@1", city.Concat(cc.CIDADE), st.id);
                    d.city_id = lci[0] != null ? lci[0].id : 0;

                    string[] f = cc.TELEFONE.Replace(" ", "").Split('/');
                    if (f.Length >= 1)
                        cre.phone_fixed = f[0];
                    if (f.Length >= 2)
                        cre.phone_mobile = f[1];

                    bdgAddress.DataSource = d;
                    bdgCredentialed.DataSource = cre;

                    pCNPJ.Enabled = false;
                    pData.Enabled = true;
                }

            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(String.Format("Ocorreu um erro:\n\n{0}\n{1}", ex.Message, ex.InnerException));
            }
        }
        public ActionResult Create([Bind(Include = "Venue_ID,Venue_Name,Venue_Description,Venue_Size")] venue venue, address address)
        {
            bool val = Validate(venue.Venue_Name);

            if (val == false)
            {
                db.addresses.Add(address);
                venue.Address_ID = address.Address_ID;
                db.venues.Add(venue);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else if (val == true)
            {
                //ViewBag.StatusMessage = "There is already a venue called: " + venue.Venue_Name + "  in the database.";

                ViewBag.Address_ID = new SelectList(db.addresses, "Address_ID", "Street_Name", venue.Address_ID);
                return(View());
            }
            //ViewBag.Address_ID = new SelectList(db.addresses, "Address_ID", "Street_Name", venue.Address_ID);
            return(View(venue));
        }
Exemple #44
0
 public void delete(address deleteItem)
 {
     address selectedItem= db.addresses.First(item => item.id == deleteItem.id);
     db.addresses.Remove(selectedItem);
     db.SaveChanges();
 }
Exemple #45
0
 Write(numberFormatter, numberOptions, address, symbol, showSymbolAddress, true, false);
Exemple #46
0
        public address selectSingle(address findItem)
        {
            address selectedItem = db.addresses.SingleOrDefault(item => item.id == findItem.id);

            return selectedItem;
        }
        protected void view_btn_Click(object sender, EventArgs e)
        {
            ChooseCPL.ClientState = "true";
            ChooseCPL.Collapsed = true;
            ChooseCPL.CollapsedText = "Search For a Different Warehouse";
            warehouseViewInfoHead.Visible = true;
            warehouseViewInfoBody.Visible = true;
            warehouseInformation_L.Text = warehouseInformation_L_hf.Value;

            //sdsProductType.SelectCommand += "and warehouse_id = " + Convert.ToString(passWarehouseID_hf.Value);

            GlobalVariables.WarehouseID = Convert.ToInt32(passWarehouseID_hf.Value);
            warehouse = warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address = address.Select(warehouse.address_id);
            //warehouse_product_Location = warehouse_product_Location.Select()

            name_txt.Text = warehouse.warehouse_name.ToString();
            address_txt.Text = address.str_add.ToString() + "" + address.city.ToString() + ", " + address.state.ToString() + "" + address.zip_plus_four.ToString();
            type_txt.Text = warehouse.warehouse_type.ToString();
            int returnValue = getWarehouseProductQty(GlobalVariables.WarehouseID);
            amountOfResources_txt.Text = Convert.ToString(returnValue);
        }
        protected void createEmail()
        {
            call_center = call_center.Select(Convert.ToInt32(DDL_Call_Center.SelectedValue));
            selected_Warehouse = selected_Warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address = address.Select(selected_Warehouse.address_id);
            //email
            callcenter_Address = call_center.call_center_name + "<br />" + "(219) 564 5567";// +address.str_add + "<br />" + address.city + " " + address.state + " " + address.zip_plus_four + "<br />" + "(219) 564 5567";

            NameOrderData = "<td colspan='1' width='10%' align='left' style='height: 87px'>" + "<b>Product Name: </b><br/><br/>";
            TypeOrderData = "<td colspan='1' width='10%' align='left' style='height: 87px'>" + "<b>Type: </b><br/><br/>";
            DescriptionOrderData = "<td colspan='1' width='10%' align='left' style='height: 87px'>" + "<b>Item Discription: </b><br/><br/>";

            for (int i = 0; i < EName.Count; i++)
            {
                NameOrderData += EName[i] + "<br/>";
                TypeOrderData += EType[i] + "<br/>";
                DescriptionOrderData += EDescription[i] + "<br/>";
            }

            NameOrderData += "</td>";
            TypeOrderData += "</td>";
            DescriptionOrderData += "</td>";

            var result = string.Join("|", EName.ToArray());

            var message = new MailMessage("*****@*****.**", "*****@*****.**");
            // here is an important part:

            message.Subject = result + " -Has just been assigned a new location";
            message.Body =
            "<Table><tr><tb><b><font size='3'>The following product has been assigned a new location:</b></font></td></tr></table>" +

            "<table id='Table1' width='100%' cellspacing='10' bgcolor='Silver'>" +
                        "<tr>" +
                            "<td colspan='12' align='left' style='border-style: none'>" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                            "<td colspan='12' style='background-color: Gray' height='5px'>" + "</td>" +
                        "</tr>" +

                        "<tr>" +
                            "<td rowspan='3' align='left' valign='top'>" +
                                "<font size='6' color='red'>DMCS</font>" +
                                "<br />" +
                                "Disaster Management Communication System" +
                                "<br />" +
                                "<br />" +
                                "<b>This order was placed at: </b><br />" +
                                callcenter_Address +
                            "</td>" +
                            "<td align='right' style='font-size: x-large; color: #808080; font-family: 'Times New Roman'; font-weight: bold;'>" + "<b>INVOICE</b>" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                            "<td>" +
                                "<br />" +
                                "<br />" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                            "<td align='right' style='color: #000000'>" +
                                "<b>Invoice/Case/Order</b> #3" +
                                "<br />" +
                                Convert.ToString(System.DateTime.Now) +
                            "</td>" +
                        "</tr>" +

                    "</table>" +

                    "<table id='Table2' width='100%' cellspacing='10' bgcolor='Silver'>" +
                        "<tr>" +
                            "<td width='50%' align='left'>" +
                                "<b>Shipping To:</b>" + "<br />" +
                                "United States Steel Corporation" + "<br />" +
                                "1 Broadway" + "<br />" +
                                "Gary,IN" + "<br />" +
                                "(219) 888-2000" + "<br />" +
                            "</td>" +

                            "<td width='50%' align='left'>" +
                                "<b>Shiping From:</b>" + "<br />" +
                                selected_Warehouse.warehouse_name + "<br />" +
                                address.str_add + "<br />" +
                                address.city + " " + address.state + " " + address.zip_plus_four + "<br />" +
                                "(219) 564 5567" + "<br />" +

                            "</td>" +
                        "</tr>" +
                    "</table>" +

                    "<table id='Table7' width='100%' cellspacing='10' bgcolor='Silver'>" +
                        "<tr>" +
                            "<td colspan='10' width='100%' align='left'>" +
                                "<br />" +
                                "<b>ORDER:</b>" +
                            "<br />" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                        "<tr>" +
                            "<td colspan='12' style='background-color: Gray' height='5px'>" + "</td>" +
                        "</tr>" +
                        "<tr>" +
                            NameOrderData +
                            TypeOrderData +
                            DescriptionOrderData +
                        "</tr>" +
                        "<tr>" +
                            "<td colspan='12' style='background-color: Gray' height='5px'>" + "</td>" +
                        "</tr>" +
                        "<tr>" +

                    "</table>" +
                "<table><tr><tb></td></tr>" +
                "<tr><tb><br/><br/><br/><br/>DO NOT RESPOND TO THIS MESSAGE." + "</td></tr>" +
                "<tr><tb>THIS WAS A AUTOMATED MESSAGE SENT FROM THE DMSC SERVERS. </td></tr></table>";

            //Set html to true! This allows for more then just a string with no breaks.
            message.IsBodyHtml = true;
            var client = new SmtpClient();
            client.EnableSsl = true;
            client.Send(message);
            /////////////////////////////////////////////////////// EMAIL SENT
        }
Exemple #49
0
 symbol = new SymbolResult(address, addrInfo.Name);
        //INSERT
        protected void insert_Click(object sender, EventArgs e)
        {
            try
            {
                address = address_insert();
                person = person_insert();
                client = client_insert();
                missing = missing_insert();

                if (Insert_deceasedYes.Checked == true)
                {
                    deceased = deceased_insert();
                }
                case_intake = case_intake_insert();
                case_client = case_client_insert();
                encounter = encounter_insert();
            }
            catch { Insert_lbl_Client_Error.Text = "There has been an error updating information for the missing client."; }
            finally { Insert_lbl_Client_Error.Text = "The missing client's information has been successfully updated."; }
        }
 : BalanceGetter(address, currency);
 //UPDATE
 protected void update_Click(object sender, EventArgs e)
 {
     try
     {
         //check to see if a insert is needed for deceased
         person = person.Select(Convert.ToInt32(Update_gvClientSearchresult.SelectedValue));
         client = client.Select(person.person_id);
         if (Update_deceasedYes.Checked == true)
         {
             person = person_update(Convert.ToInt32(Update_gvClientSearchresult.SelectedValue));
             missing = missing_update(person.person_id);
             //check if update of insert of deceased
             deceased = deceased.Select(client.client_id);
             if (deceased.deceased_id == 0) { deceased = deceased_insert_For_Update(); }
             else { deceased = deceased_update(person.person_id); }
         }
         else
         {
             person = person_update(Convert.ToInt32(Update_gvClientSearchresult.SelectedValue));
             missing = missing_update(person.person_id);
         }
         address = address_update(person.address_id);
         client = client_update(person.person_id);
         encounter = encounter_insert();
         Update_refreshclient();
     }
     catch { Update_lbl_Client_Error.Text = "There has been an error updating information for the missing client."; }
     finally { Update_lbl_Client_Error.Text = "The missing client's information has been successfully updated."; }
 }
 public customerAddressDto()
 {
     isdefault     = false;
     shutout       = false;
     reciptaddress = new address();
 }
Exemple #54
0
        public DataTable PrepararPedidos()
        {
            DataTable  Prestashop = new DataTable("Ordenes");
            DataColumn column;
            DataRow    row;

            pedidosEcommerce = ListaPedidosPagados();

            customer      cliente       = new customer();
            address       direccion_cli = new address();
            address       direccion_ent = new address();
            order_payment pago          = new order_payment();

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Int32");
            column.ColumnName = "ped_id";
            column.Caption    = "ped_id";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "ped_ref";
            column.Caption    = "ped_ref";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "ped_fecha";
            column.Caption    = "ped_fecha";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "ped_ubigeo_ent";
            column.Caption    = "ped_ubigeo_ent";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "ped_dir_ent";
            column.Caption    = "ped_dir_ent";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Decimal");
            column.ColumnName = "ped_total_sigv";
            column.Caption    = "ped_total_sigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Decimal");
            column.ColumnName = "ped_total_cigv";
            column.Caption    = "ped_total_cigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Decimal");
            column.ColumnName = "ped_dcto_sigv";
            column.Caption    = "ped_dcto_sigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Decimal");
            column.ColumnName = "ped_dcto_cigv";
            column.Caption    = "ped_dcto_cigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Decimal");
            column.ColumnName = "ped_ship_sigv";
            column.Caption    = "ped_ship_sigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Decimal");
            column.ColumnName = "ped_ship_cigv";
            column.Caption    = "ped_ship_cigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Int32");
            column.ColumnName = "cli_id";
            column.Caption    = "cli_id";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_nombres";
            column.Caption    = "cli_nombres";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_apellidos";
            column.Caption    = "cli_apellidos";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_fec_nac";
            column.Caption    = "cli_fec_nac";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_email";
            column.Caption    = "cli_email";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_ubigeo";
            column.Caption    = "cli_ubigeo";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_direc";
            column.Caption    = "cli_direc";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_telf";
            column.Caption    = "cli_telf";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "cli_dni";
            column.Caption    = "cli_dni";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Int32");
            column.ColumnName = "det_artic";
            column.Caption    = "det_artic";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "det_artic_ref";
            column.Caption    = "det_artic_ref";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "det_desc_artic";
            column.Caption    = "det_desc_artic";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Int32");
            column.ColumnName = "det_cant";
            column.Caption    = "det_cant";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Double");
            column.ColumnName = "det_prec_sigv";
            column.ColumnName = "det_prec_sigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Double");
            column.ColumnName = "det_dcto_sigv";
            column.ColumnName = "det_dcto_sigv";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "pag_metodo";
            column.ColumnName = "pag_metodo";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "pag_nro_trans";
            column.ColumnName = "pag_nro_trans";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "pag_nro_tarj";
            column.ColumnName = "pag_nro_tarj";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.String");
            column.ColumnName = "pag_fecha";
            column.ColumnName = "pag_fecha";
            Prestashop.Columns.Add(column);

            column            = new DataColumn();
            column.DataType   = System.Type.GetType("System.Double");
            column.ColumnName = "pag_monto";
            column.ColumnName = "pag_monto";
            Prestashop.Columns.Add(column);

            foreach (order orden in pedidosEcommerce)
            {
                int idCliente = Convert.ToInt32((orden).id_customer);
                cliente = GetCliente(idCliente);

                int idDireccion = Convert.ToInt32((orden).id_address_delivery);
                direccion_ent = GetDireccion(idDireccion);

                int idDireccion2 = Convert.ToInt32((orden).id_address_invoice);
                direccion_cli = GetDireccion(idDireccion);

                string idPago = Convert.ToString((orden).reference);
                pago = GetPayment(idPago);

                foreach (order_row detalle in orden.associations.order_rows)
                {
                    row                   = Prestashop.NewRow();
                    row["ped_id"]         = orden.id;
                    row["ped_ref"]        = orden.reference;
                    row["ped_fecha"]      = orden.date_add;
                    row["ped_ubigeo_ent"] = direccion_ent.id_state;
                    row["ped_dir_ent"]    = direccion_ent.address1;
                    row["ped_total_sigv"] = orden.total_paid_tax_excl;
                    row["ped_total_cigv"] = orden.total_paid_real;
                    row["ped_dcto_sigv"]  = orden.total_discounts_tax_excl;
                    row["ped_dcto_cigv"]  = orden.total_discounts;
                    row["ped_ship_sigv"]  = orden.total_shipping_tax_excl;
                    row["ped_ship_cigv"]  = orden.total_shipping;
                    row["cli_id"]         = orden.id_customer;
                    row["cli_nombres"]    = cliente.firstname;
                    row["cli_apellidos"]  = cliente.lastname;
                    row["cli_fec_nac"]    = cliente.birthday;
                    row["cli_email"]      = cliente.email;
                    row["cli_ubigeo"]     = direccion_cli.id_state;
                    row["cli_direc"]      = direccion_cli.address1;
                    row["cli_telf"]       = direccion_cli.phone;
                    row["cli_dni"]        = direccion_cli.dni;
                    row["det_artic"]      = detalle.product_id;
                    row["det_artic_ref"]  = detalle.product_reference;
                    row["det_desc_artic"] = detalle.product_name;
                    row["det_cant"]       = detalle.product_quantity;
                    row["det_prec_sigv"]  = detalle.product_price;
                    row["det_dcto_sigv"]  = detalle.unit_price_tax_excl;
                    row["pag_metodo"]     = pago.payment_method;
                    row["pag_nro_trans"]  = pago.transaction_id;
                    row["pag_nro_tarj"]   = pago.card_number;
                    row["pag_fecha"]      = pago.date_add;
                    row["pag_monto"]      = pago.amount;
                    Prestashop.Rows.Add(row);
                }
            }
            return(Prestashop);
        }
Exemple #55
0
        /// <summary>
        /// Расчитывает и сохраняет пользовательские ключи для заявления
        /// </summary>
        /// <param name="keyTypeList">
        /// The key Type List.
        /// </param>
        /// <param name="pd">
        /// The pd.
        /// </param>
        /// <param name="doc">
        /// The doc.
        /// </param>
        /// <param name="addr1">
        /// The addr 1.
        /// </param>
        /// <param name="addr2">
        /// The addr 2.
        /// </param>
        /// <param name="medicalInsurances">
        /// The medical Insurances.
        /// </param>
        /// <param name="okato">
        /// The okato.
        /// </param>
        /// <returns>
        /// The <see cref="IList{SearchKey}"/>.
        /// </returns>
        public IList <SearchKey> CalculateUserKeys(
            IList <SearchKeyType> keyTypeList,
            InsuredPersonDatum pd,
            Document doc,
            address addr1,
            address addr2,
            IList <MedicalInsurance> medicalInsurances,
            string okato)
        {
            var result = new List <SearchKey>();

            foreach (var kt in keyTypeList)
            {
                // Перекодирование типа ключа
                var keyType = new database.business.model.SearchKeyType
                {
                    RowId                = kt.Id,
                    FirstName            = kt.FirstName,
                    LastName             = kt.LastName,
                    MiddleName           = kt.MiddleName,
                    Birthday             = kt.Birthday,
                    Birthplace           = kt.Birthplace,
                    Snils                = kt.Snils,
                    DocumentType         = kt.DocumentType,
                    DocumentSeries       = kt.DocumentSeries,
                    DocumentNumber       = kt.DocumentNumber,
                    Okato                = kt.Okato,
                    PolisType            = kt.PolisType,
                    PolisSeria           = kt.PolisSeria,
                    PolisNumber          = kt.PolisNumber,
                    FirstNameLength      = kt.FirstNameLength,
                    LastNameLength       = kt.LastNameLength,
                    MiddleNameLength     = kt.MiddleNameLength,
                    BirthdayLength       = kt.BirthdayLength,
                    AddressStreet        = kt.AddressStreet,
                    AddressStreetLength  = kt.AddressStreetLength,
                    AddressHouse         = kt.AddressHouse,
                    AddressRoom          = kt.AddressRoom,
                    AddressStreet2       = kt.AddressStreet2,
                    AddressStreetLength2 = kt.AddressStreetLength2,
                    AddressHouse2        = kt.AddressHouse2,
                    AddressRoom2         = kt.AddressRoom2,
                    IdenticalLetters     = kt.IdenticalLetters
                };

                // Перекодировка персональных данных
                var personData = new database.business.model.InsuredPersonDatum
                {
                    RowId      = pd.Id,
                    LastName   = pd.LastName,
                    FirstName  = pd.FirstName,
                    MiddleName = pd.MiddleName,
                    Birthday   = pd.Birthday,
                    Birthplace = pd.Birthplace,
                    Snils      = pd.Snils,
                };

                // Перекодировка документа
                database.business.model.Document document = null;
                if (doc != null && doc.DocumentType != null)
                {
                    document = new database.business.model.Document
                    {
                        RowId          = doc.Id,
                        DocumentTypeId = doc.DocumentType.Id,
                        Series         = doc.Series,
                        Number         = doc.Number,
                    };
                }

                // Перекодировка адреса регистрации
                var address1 = new database.business.model.address
                {
                    RowId  = addr1.Id,
                    Street = addr1.Street,
                    House  = addr1.House,
                    Room   = addr1.Room,
                    Okato  = addr1.Okato,
                };

                // Перекодировка адреса проживания
                database.business.model.address address2 = null;
                if (addr2 != null)
                {
                    address2 = new database.business.model.address
                    {
                        RowId  = addr2.Id,
                        Street = addr2.Street,
                        House  = addr2.House,
                        Room   = addr2.Room,
                        Okato  = addr2.Okato,
                    };
                }

                // Перекодировка страховок
                foreach (var medicalInsurance in medicalInsurances)
                {
                    var insurance = new database.business.model.MedicalInsurance
                    {
                        RowId       = medicalInsurance.Id,
                        PolisTypeId = medicalInsurance.PolisType.Id,
                        PolisSeria  = medicalInsurance.PolisSeria,
                        PolisNumber = medicalInsurance.PolisNumber,
                    };

                    // Расчет ключа
                    var keyValue = database.business.ObjectFactory.GetPseudonymizationManager()
                                   .CalculateUserSearchKey(
                        keyType,
                        personData,
                        document,
                        address1,
                        address2,
                        insurance,
                        okato);

                    var conceptCacheManager = ObjectFactory.GetInstance <IConceptCacheManager>();
                    var searchKey           = new SearchKey
                    {
                        KeyValue        = keyValue,
                        KeyType         = kt,
                        DocumentUdlType =
                            doc != null && doc.DocumentType != null
                                ? conceptCacheManager.GetById(doc.DocumentType.Id)
                                : null
                    };

                    result.Add(searchKey);
                }
            }

            return(result);
        }
Exemple #56
0
        string ConvertObjectToXmlStr()
        {
            List <AmloToCustomer> customerResultList = null;
            AmloToCustomer        customerData       = null;


            customerData = new AmloToCustomer();
            List <reportingdetail> reportingDetailList = new List <reportingdetail>();
            List <report>          reportList          = new List <report>();
            reportingdetail        reportingdetailData = null;

            List <person> personList = new List <person>();
            person        personData = null;


            List <contact> contactList = new List <contact>();
            contact        contactData = null;
            address        addressData = null;

            // #1
            report report = null;

            //<reportingdetail orgid="0107557000420" orgname="ธนาคารเอเอ็นแซด (ไทย) จำกัด (มหาชน)"/>
            reportingdetailData = new reportingdetail()
            {
                orgid = "0107557000420", orgname = "ธนาคารเอเอ็นแซด (ไทย) จำกัด (มหาชน)"
            };

            reportingDetailList.Add(reportingdetailData);



            customerData.reportingdetail = reportingDetailList;


            //<report>
            report = new report();

            //<reportorgdetail branchcode="00000" orgname="ธนาคารเอเอ็นแซด (ไทย) จำกัด (มหาชน)" telno="022639700"/>
            report.reportingdetail = new reportingdetail()
            {
                branchcode = "00000", orgname = "ธนาคารเอเอ็นแซด (ไทย) จำกัด (มหาชน)", telno = "022639700"
            };

            //<dcn value="09-00107557000420-00000-255912-000084" doctype="1-05-9" revision="" date="" refdocno="" refdoctype=""/>
            report.dcn = new dcn()
            {
                value = "09-00107557000420-00000-255912-000084", doctype = "1-05-9", revision = "", date = "", refdocno = "", refdoctype = ""
            };

            //<reporttype value="2"/>
            report.reportType = new reportType()
            {
                value = "2"
            };



            //--------------------------------------------------- ส่วนที่ 1 --------------------------------------------//
            //<person anothermethod="TRUE" am_transactionmethod="DOCUMENT" am_customeraccno="100032" value="TRANSACTING-PERSON" relationship="SELF" relationshipdesc="">

            personData = new person()
            {
                anothermethod        = "TRUE",
                am_transactionmethod = "DOCUMENT",
                value            = "TRANSACTING-PERSON",
                relationship     = "SELF",
                relationshipdesc = ""
            };

            //<name type="LEGAL" title="" firstname="[NAV]" middlename="" lastname="" dateofbirth="" nationality="STATELESS" legalpersonid="[NAV]"/>
            personData.personName = new personName()
            {
                type          = "LEGAL",
                title         = "",
                firstname     = "[NAV]",
                middlename    = "",
                lastname      = "",
                dateofbirth   = "",
                nationality   = "STATELESS",
                legalpersonid = "[NAV]"
            };

            //<occupation companyname="" businesstype="" businesstype_desc="" occ_type="99" occ_desc="[NAV]"/>
            personData.occupation = new occupation()
            {
                companyname = "", businesstype = "", businesstype_desc = "", occ_type = "99", occ_desc = "[NAV]",
            };



            addressData = new address()
            {
                no          = "[NAV]",
                moo         = "",
                building    = "",
                soi         = "",
                road        = "",
                subdistrict = "[NAV]",
                address1    = "",
                address2    = "",
                district    = "[NAV]",
                province    = "[NAV]",
                zipcode     = "[NAV]",
                countrycode = "TH"
            };

            contactData = new contact()
            {
                type = "ADDR", address = addressData
            };

            contactList.Add(contactData);

            contactData = new contact()
            {
                type = "COMPANY-ADDR", noinfo = "TRUE"
            };
            contactList.Add(contactData);
            contactData = new contact()
            {
                type = "CONTACT-ADDR", noinfo = "TRUE"
            };
            contactList.Add(contactData);

            personData.contact = contactList;

            personList.Add(personData);

            //--------------------------------------------------- ส่วนที่ 2 --------------------------------------------//

            //<person value="RELATED-PERSON" relationship="DELEGATOR" relationshipdesc="">
            personData = new person()
            {
                value            = "RELATED-PERSON",
                relationship     = "DELEGATOR",
                relationshipdesc = ""
            };

            //<name type="LEGAL" title="" firstname="MINOR INTERNATIONAL PUBLIC CO LTD" middlename="" lastname="" dateofbirth="" nationality="TH" legalpersonid="0107536000919"/>
            //< occupation companyname = "" businesstype = "" businesstype_desc = "" occ_type = "0" occ_desc = "" />
            personData.personName = new personName()
            {
                type          = "LEGAL",
                title         = "",
                firstname     = "MINOR INTERNATIONAL PUBLIC CO LTD",
                middlename    = "",
                lastname      = "",
                dateofbirth   = "",
                nationality   = "TH",
                legalpersonid = "0107536000919"
            };

            //<occupation companyname="" businesstype="" businesstype_desc="" occ_type="0" occ_desc=""/>
            personData.occupation = new occupation()
            {
                companyname = "", businesstype = "", businesstype_desc = "", occ_type = "0", occ_desc = "",
            };



            /*<contact type="ADDR">
             * <address no="99" moo="" building="BERLI JUCKER BUILDING 16TH FLOOR" soi="SOI RUBIA" road="SUKHUMVIT 42" subdistrict="PRAKANONG" address1="" address2="" district="KLONGTOEY" province="BANGKOK" zipcode="10110" countrycode="TH"/>
             * </contact>*/
            addressData = new address()
            {
                no          = "99",
                moo         = "",
                building    = "BERLI JUCKER BUILDING 16TH FLOOR",
                soi         = "SOI RUBIA",
                road        = "SUKHUMVIT 42",
                subdistrict = "PRAKANONG",
                address1    = "",
                address2    = "",
                district    = "KLONGTOEY",
                province    = "BANGKOK",
                zipcode     = "10110",
                countrycode = "TH"
            };

            contactData = new contact()
            {
                type = "ADDR", address = addressData
            };

            contactList.Add(contactData);

            contactData = new contact()
            {
                type = "COMPANY-ADDR", noinfo = "TRUE"
            };
            contactList.Add(contactData);
            contactData = new contact()
            {
                type = "CONTACT-ADDR", noinfo = "TRUE"
            };
            contactList.Add(contactData);

            personData.contact = contactList;


            personData.iddoc = new iddoc()
            {
                type = "99", typedesc = "[NAV]", idno = "[NAV]", issueby = "[NAV]", issuedate = "[NAV]", expiredate = "[NAV]"
            };

            personList.Add(personData);
            //--------------------------------------------------- ส่วนที่ 3 --------------------------------------------//



            report.person = personList;

            reportList.Add(report);
            customerData.report = reportList;


            /*<ersreport version="1.0">
             * <reportingdetail orgid="0107557000420" orgname="ธนาคารเอเอ็นแซด (ไทย) จำกัด (มหาชน)"/>
             * <report>
             * <reportorgdetail branchcode="00000" orgname="ธนาคารเอเอ็นแซด (ไทย) จำกัด (มหาชน)" telno="022639700"/>
             * <dcn value="09-00107557000420-00000-255912-000084" doctype="1-05-9" revision="" date="" refdocno="" refdoctype=""/>
             * <reporttype value="2"/>
             * <!--  ข้อมูลผู้ทำธุรกรรม  -->
             * <!--  ส่วนที่ 1  -->
             * 
             * <person anothermethod="TRUE" am_transactionmethod="DOCUMENT" am_customeraccno="100032" value="TRANSACTING-PERSON" relationship="SELF" relationshipdesc="">
             * <name type="LEGAL" title="" firstname="[NAV]" middlename="" lastname="" dateofbirth="" nationality="STATELESS" legalpersonid="[NAV]"/>
             * <occupation companyname="" businesstype="" businesstype_desc="" occ_type="99" occ_desc="[NAV]"/>
             * 
             * <contact type="ADDR">
             * <address no="[NAV]" moo="" building="" soi="" road="" subdistrict="[NAV]" address1="" address2="" district="[NAV]" province="[NAV]" zipcode="[NAV]" countrycode="TH"/>
             * </contact>
             * <contact type="COMPANY-ADDR" noinfo="TRUE"/>
             * <contact type="CONTACT-ADDR" noinfo="TRUE"/>
             * <iddoc type="99" typedesc="[NAV]" idno="[NAV]" issueby="[NAV]" issuedate="[NAV]" expiredate="[NAV]"/>
             * </person>
             * <!--
             * ส่วนที่ 2 ข้อมูลผู้ร่วมทำธุรกรรม,ผู้มอบหมาย,ผู้มอบอำนาจ
             * -->
             * 
             * <person value="RELATED-PERSON" relationship="DELEGATOR" relationshipdesc="">
             * <name type="LEGAL" title="" firstname="MINOR INTERNATIONAL PUBLIC CO LTD" middlename="" lastname="" dateofbirth="" nationality="TH" legalpersonid="0107536000919"/>
             * <occupation companyname="" businesstype="" businesstype_desc="" occ_type="0" occ_desc=""/>
             * 
             * <contact type="ADDR">
             * <address no="99" moo="" building="BERLI JUCKER BUILDING 16TH FLOOR" soi="SOI RUBIA" road="SUKHUMVIT 42" subdistrict="PRAKANONG" address1="" address2="" district="KLONGTOEY" province="BANGKOK" zipcode="10110" countrycode="TH"/>
             * </contact>
             * 
             * <contact type="COMPANY-ADDR">
             * <address no="99" moo="" building="BERLI JUCKER BUILDING 16TH FLOOR" soi="SOI RUBIA" road="SUKHUMVIT 42" subdistrict="PRAKANONG" address1="" address2="" district="KLONGTOEY" province="BANGKOK" zipcode="10110" countrycode="TH"/>
             * </contact>
             * 
             * <contact type="CONTACT-ADDR">
             * <address no="99" moo="" building="BERLI JUCKER BUILDING 16TH FLOOR" soi="SOI RUBIA" road="SUKHUMVIT 42" subdistrict="PRAKANONG" address1="" address2="" district="KLONGTOEY" province="BANGKOK" zipcode="10110" countrycode="TH"/>
             * </contact>
             * <iddoc type="99" typedesc="AFFIDAVIT" idno="0107536000919" issueby="MINISTRY OF COMMERCE" issuedate="2559-10-13" expiredate="[NOEXP]"/>
             * </person>
             * <!--  ส่วนที่ 3 ข้อเท็จจริงเกี่ยวกับการทำธุรกรรม  -->
             * 
             * <tsc date="2559-12-22">
             * <tscentry>
             * <typeoftsc transtype="DOMESTIC" type="SEND" desc=""/>
             * <transferdetail type="SEND" accountno="100032" refno="FTB1612220002" org="ANZ BANK (THAI) PUBLIC CO LTD" orgcountry="TH">
             * <td fullname="MINOR INTERNATIONAL PUBLIC CO LTD" address="99 BERLI JUCKER BUILDING 16TH FLOOR SOI RUBIA" contactaddress="SUKHUMVIT 42 PRAKANONG KLONGTOEY BANGKOK 10110" idtype="OTHER" idtypedesc="AFFIDAVIT" idno="0107536000919" idissuer="MINISTRY OF COMMERCE" idexpiredate="" dateofbirth="" placeofbirth=""/>
             * </transferdetail>
             * <transferdetail type="REC" accountno="0126321007" refno="FTB1612220002" org="CITIBANK N.A." orgcountry="TH">
             * <td fullname="MINOR INTERNATIONAL PUBLIC CO LTD" address="BANGKOK" contactaddress="" idtype="OTHER" idtypedesc="AFFIDAVIT" idno="0107536000919" idissuer="MINISTRY OF COMMERCE" idexpiredate="" dateofbirth="" placeofbirth=""/>
             * </transferdetail>
             * <amount valueinbaht="199999850.00" valueinbahttxt="หนึ่งร้อยเก้าสิบเก้าล้านเก้าแสนเก้าหมื่นเก้าพันแปดร้อยห้าสิบบาทถ้วน"/>
             * </tscentry>
             * <totalamount valueinbaht="199999850.00" valueinbahttxt="หนึ่งร้อยเก้าสิบเก้าล้านเก้าแสนเก้าหมื่นเก้าพันแปดร้อยห้าสิบบาทถ้วน"/>
             * <!--  Data From Head  -->
             * <benfperson firstname="[NAV]" middlename="" lastname=""/>
             * <objective type=""> NEW LOAN DRAWDOWN ON 22 DECEMBER 2016. </objective>
             * <!--  ส่วนที่ 4  -->
             * </tsc>
             * <record date="2559-12-22"/>
             * </report>*/


            //   customerResultList.Add(customerData);
            string data = string.Format("{0}", DTO.Util.XmlSerializerHelper.SerializeObjectToString(customerData));

            return(data);
        }
Exemple #57
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (!validator.Validate())
                return;
              //try
               // {
                //validações
                if (!Validations.isCPFCNPJ(tfCNPJ.EditValue.ToString(), false))
                {
                    XtraMessageBox.Show("CNPJ incorreto, verifique!");
                    return;
                }

                var countcnpj = customer.repo.ExecuteScalar<string>("SELECT COUNT(id) FROM customers WHERE document=@0",
                    tfCNPJ.EditValue);
                if (!countcnpj.Equals(DBNull.Value) && !String.IsNullOrEmpty(countcnpj))
                {
                    if (Convert.ToInt32(countcnpj) >= 1)
                    {
                        XtraMessageBox.Show("CNPJ já cadastrado, verifique!", "Cadore Tecnologia");
                        return;
                    }
                }
                SearchCPFCNPJUtil cc = new SearchCPFCNPJUtil();
                if (cc.Search(Document.CNPJ, tfCNPJ.Text))
                {
                    customer cre = new customer();
                    address d = new address();

                    cre.document = cc.NCNPJ;
                    if (cre.document.Length == 18)
                        cre.type = 0;
                    else
                        cre.type = 1;
                    cre.inactive = false;
                    cre.corporate_name = cc.RAZAOSOCIAL;
                    cre.fantasy_name = cc.FANTASIA;
                    d.name = cc.ENDERECO;
                    d.number = cc.NUMERO;
                    d.complement = cc.COMPLEMENTO;
                    d.district = cc.BAIRRO;
                    d.cep = cc.CEP;

                    // para evitar problemas com estados e cidades try para ignorar esta etapa caso haja erros!
                    try
                    {
                        state st = state.SingleOrDefault("WHERE symbol=@0", cc.UF);
                        d.state_id = st != null ? st.id : 0;
                        List<city> lci = city.Fetch("WHERE remove_character(name) ILIKE @0 AND state_id=@1",
                            city.Concat(cc.CIDADE), st.id);
                        d.city_id = lci != null ? lci[0].id : 0;
                    } catch (Exception) { }

                    if (!String.IsNullOrEmpty(cc.TELEFONE))
                    {
                        string[] f = cc.TELEFONE.Replace(" ", "").Split('/');
                        if (f.Length >= 1)
                            cre.phone_fixed = f[0];
                        if (f.Length >= 2)
                            cre.phone_mobile = f[1];
                    }

                    bdgAddress.DataSource = d;
                    bdgCustomer.DataSource = cre;
                    tfCNPJ.Properties.ReadOnly = true;
                    tfType.EditValue = cc.TIPO;
                    tfSituation.EditValue = cc.SITUACAOCNPJ;
                    tfDateOpening.EditValue = cc.ABERTURA;
                    tfCnae1.EditValue = cc.CNAE1;
                    tfCnae2.EditValue = cc.CNAE2;
                    tfJuridic.EditValue = cc.NATUREZA;
                }
            //}
            //catch (Exception ex)
            //{
            //    XtraMessageBox.Show(String.Format("Ocorreu um erro:\n\n{0}\n{1}", ex.Message, ex.InnerException));
            //}
        }