private void btnAddShipper_Click(object sender, System.EventArgs e) { ShippersInfo shippersInfo = new ShippersInfo(); shippersInfo.ShipperTag = this.txtShipperTag.Text.Trim(); shippersInfo.ShipperName = this.txtShipperName.Text.Trim(); if (!this.ddlReggion.GetSelectedRegionId().HasValue) { this.ShowMsg("请选择地区", false); return; } shippersInfo.RegionId = this.ddlReggion.GetSelectedRegionId().Value; shippersInfo.Address = this.txtAddress.Text.Trim(); shippersInfo.CellPhone = this.txtCellPhone.Text.Trim(); shippersInfo.TelPhone = this.txtTelPhone.Text.Trim(); shippersInfo.Zipcode = this.txtZipcode.Text.Trim(); shippersInfo.IsDefault = this.chkIsDefault.SelectedValue; shippersInfo.Remark = this.txtRemark.Text.Trim(); if (!this.ValidationShipper(shippersInfo)) { return; } if (string.IsNullOrEmpty(shippersInfo.CellPhone) && string.IsNullOrEmpty(shippersInfo.TelPhone)) { this.ShowMsg("手机号码和电话号码必填其一", false); return; } if (SalesHelper.AddShipper(shippersInfo)) { this.ShowMsg("成功添加了一个发货信息", true); return; } this.ShowMsg("添加发货信息失败", false); }
private void btnAddShipper_Click(object sender, EventArgs e) { int storeId = HiContext.Current.Manager.StoreId; ShippersInfo defaultOrFirstShipper = SalesHelper.GetDefaultOrFirstShipper(storeId); ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(storeId); ShippersInfo shippersInfo = new ShippersInfo(); shippersInfo.SupplierId = storeId; shippersInfo.ShipperTag = this.txtShipperTag.Text.Trim(); shippersInfo.ShipperName = this.txtShipperName.Text.Trim(); if (!this.ddlReggion.GetSelectedRegionId().HasValue) { this.ShowMsg("请选择地区", false); } else { shippersInfo.RegionId = this.ddlReggion.GetSelectedRegionId().Value; shippersInfo.Address = this.txtAddress.Text.Trim(); shippersInfo.CellPhone = this.txtCellPhone.Text.Trim(); shippersInfo.TelPhone = this.txtTelPhone.Text.Trim(); shippersInfo.Zipcode = this.txtZipcode.Text.Trim(); shippersInfo.IsDefault = (defaultOrFirstShipper == null || !defaultOrFirstShipper.IsDefault); shippersInfo.IsDefaultGetGoods = (defaultGetGoodsShipperBysupplierId == null || !defaultGetGoodsShipperBysupplierId.IsDefaultGetGoods); shippersInfo.Remark = this.txtRemark.Text.Trim(); shippersInfo.WxOpenId = ""; if (this.ValidationShipper(shippersInfo)) { if (string.IsNullOrEmpty(shippersInfo.CellPhone) && string.IsNullOrEmpty(shippersInfo.TelPhone)) { this.ShowMsg("手机号码和电话号码必填其一", false); } else if (SalesHelper.AddShipper(shippersInfo)) { this.ShowMsg("成功添加了一个发货信息", true, "Shippers.aspx"); } else { this.ShowMsg("添加发货信息失败", false); } } } }
private void btnAddShipper_Click(object sender, EventArgs e) { ShippersInfo info2 = new ShippersInfo(); info2.ShipperTag = txtShipperTag.Text.Trim(); info2.ShipperName = txtShipperName.Text.Trim(); ShippersInfo shipper = info2; if (!ddlReggion.GetSelectedRegionId().HasValue) { ShowMsg("请选择地区", false); } else { shipper.RegionId = ddlReggion.GetSelectedRegionId().Value; shipper.Address = txtAddress.Text.Trim(); shipper.CellPhone = txtCellPhone.Text.Trim(); shipper.TelPhone = txtTelPhone.Text.Trim(); shipper.Zipcode = txtZipcode.Text.Trim(); shipper.IsDefault = chkIsDefault.SelectedValue; shipper.Remark = txtRemark.Text.Trim(); if (ValidationShipper(shipper)) { if (string.IsNullOrEmpty(shipper.CellPhone) && string.IsNullOrEmpty(shipper.TelPhone)) { ShowMsg("手机号码和电话号码必填其一", false); } else if (SalesHelper.AddShipper(shipper)) { ShowMsg("成功添加了一个发货信息", true); } else { ShowMsg("添加发货信息失败", false); } } } }
private void btnAddShipper_Click(object sender, EventArgs e) { ShippersInfo shipper = new ShippersInfo(); string str = "0"; if (this.txtShipperType.Items[0].Selected && !this.txtShipperType.Items[1].Selected) { str = "1"; } else if (!this.txtShipperType.Items[0].Selected && this.txtShipperType.Items[1].Selected) { str = "2"; } else if (this.txtShipperType.Items[0].Selected && this.txtShipperType.Items[1].Selected) { str = "3"; } shipper.ShipperTag = str; shipper.ShipperName = this.txtShipperName.Text.Trim(); if (!this.ddlReggion.GetSelectedRegionId().HasValue) { this.ShowMsg("请选择地区", false); } else { shipper.RegionId = this.ddlReggion.GetSelectedRegionId().Value; shipper.Address = this.txtAddress.Text.Trim(); shipper.CellPhone = this.txtTelPhone.Text.Trim(); shipper.TelPhone = this.txtTelPhone.Text.Trim(); shipper.Zipcode = ""; shipper.IsDefault = true; shipper.Remark = ""; shipper.wid = this.wid; int result = 0; int.TryParse(this.ShipperId.Value, out result); shipper.ShipperId = result; if (this.ValidationShipper(shipper)) { if (string.IsNullOrEmpty(shipper.CellPhone) && string.IsNullOrEmpty(shipper.TelPhone)) { this.ShowMsg("手机号码和电话号码必填其一", false); } else if (SalesHelper.AddShipper(shipper)) { if (this.Task.Value == "EDIT") { this.Task.Value = "ADD"; this.txtShipperType.SelectedValue = ""; this.txtShipperType.Enabled = true; this.txtShipperName.Text = ""; this.ddlReggion.SetSelectedRegionId(0); this.txtAddress.Text = ""; this.ShipperId.Value = ""; this.txtTelPhone.Text = ""; this.txtShipperType.ClearSelection(); this.editType.Text = "新增发货地址信息"; this.ShowMsg("成功修改了一个发货信息", true); } else { this.ShowMsg("成功添加了一个发货信息", true); } this.BindShippers(wid); } else { this.ShowMsg("添加发货信息失败", false); } } } }