Пример #1
0
 /// <summary>
 /// 根据航次ID获取实体
 /// </summary>
 /// <param name="voyageID">实体主键</param>
 /// <returns>实体</returns>
 public IList<FCLCustomerInfo> GetByFCLIDAddBlank(string FCLID)
 {
     IList<FCLCustomerInfo> list = new List<FCLCustomerInfo>();
     if (string.IsNullOrEmpty(FCLID))
     {
         FCLCustomerInfo fInfo = new FCLCustomerInfo();
         fInfo.FCLID = FCLID;
         list.Add(fInfo);
     }
     else
     {
         list = dal.GetByFCLID(FCLID);
         FCLCustomerInfo fInfo = new FCLCustomerInfo();
         fInfo.FCLID = FCLID;
         list.Add(fInfo);
     }
     return list;
 }
Пример #2
0
        protected void gvCustomerList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.VoyageId))
                {
                    ShowMsg("请先保存集装箱费用报表再填写客户提货单。");
                    return;
                }
                string id = e.CommandArgument.ToString();
                if (e.CommandName == "btnDel")
                {
                    new FCLCustomer().Delete(id);
                }
                else
                {
                    #region 控件
                    GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                    TextBox tbName = (TextBox)gvr.FindControl("tbName");
                    TextBox tbFee = (TextBox)gvr.FindControl("tbFee");
                    TextBox tbgp20 = (TextBox)gvr.FindControl("tbgp20");
                    TextBox tbgp40 = (TextBox)gvr.FindControl("tbgp40");
                    TextBox tbdp20 = (TextBox)gvr.FindControl("tbdp20");
                    TextBox tbdp40 = (TextBox)gvr.FindControl("tbdp40");
                    #endregion

                    FCLCustomerInfo info = new FCLCustomerInfo(id);
                    info.Name = tbName.Text;
                    info.Fee = tbFee.Text;
                    info.gp20 = tbgp20.Text;
                    info.gp40 = tbgp40.Text;
                    info.dp20 = tbdp20.Text;
                    info.dp40 = tbdp40.Text;
                    VoyageFCLInfo vfInfo = new VoyageFCL().GetByVoyageID(this.VoyageId);
                    string fclID = (vfInfo == null) ? string.Empty : vfInfo.ID;
                    info.FCLID = fclID;

                    if (e.CommandName == "btnEdit")
                    {
                        new FCLCustomer().Update(info);
                    }

                    if (e.CommandName == "btnAdd")
                    {
                        new FCLCustomer().Add(info);
                    }
                }
                BindCustomerList();
                ShowMsg("操作成功!");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
Пример #3
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(FCLCustomerInfo cInfo)
 {
     return dal.Add(cInfo);
 }
Пример #4
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="ID">实体主键</param>
 /// <returns></returns>
 public void Delete(string ID)
 {
     FCLCustomerInfo cInfo = new FCLCustomerInfo(ID);
     dal.Delete(cInfo);
 }
Пример #5
0
 /// <summary>
 /// 更新费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(FCLCustomerInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }