Ejemplo n.º 1
0
 private void ModelToTextBox(TPurchasePlan info)
 {
     if (!string.IsNullOrEmpty(info.Content.Provider)) //供应商
     {
         //hidProvider.Value = info.Content.Provider;
         Base_ClientInfo tempClient = ClientInfoService.Instance.GetClientInfoByCode(info.Content.Provider);
         if (tempClient != null)
         {
             //txtProviderName.Text = tempClient.ShortName;
             //hidProviderName.Value = tempClient.ShortName;
         }
     }
     txtPurchasePlanBillCode.Text = info.Content.PurchaseBillCode;        //入库单号
     txtPurchasePlanDate.Text     = info.Content.PurchaseDate.ToString(); //入库日期
     txtDeptName.Text             = info.Content.DeptName;
     lblOperator.Text             = user_idao.GetUserInfo(info.Content.Operator).Rows[0]["User_Name"].ToString();
     //if (!string.IsNullOrEmpty(info.Content.CheckMan)) //经办人
     //{
     //    //hidPurchaseMan.Value = info.Content.CheckMan;
     //    //EmployeeInfo tempEmployee = EmployeeInfoService.Instance.GetEmployeeInfoByCode(info.Content.CheckMan);
     //    //if (tempEmployee != null)
     //    //{
     //    //    txTPurchasePlanManName.Text = tempEmployee.Name;
     //    //    hidPurchaseManName.Value = tempEmployee.Name;
     //    //}
     //}
 }
Ejemplo n.º 2
0
        public bool UpdateInfo(Base_ClientInfo info)
        {
            var query = from item in dc.Base_ClientInfo
                        where item.ID == info.ID
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
Ejemplo n.º 3
0
        public int InsertInfo(Base_ClientInfo info)
        {
            string msg = dao.ValidateRepeat(info);

            if (msg == "")
            {
                return(dao.InsertInfo(info));
            }
            else
            {
                throw new Exception(msg);
            }
        }
Ejemplo n.º 4
0
 private void ModelToTextBox(TPurchaseIndent info)
 {
     if (!string.IsNullOrEmpty(info.Content.Provider)) //供应商
     {
         Base_ClientInfo tempClient = ClientInfoService.Instance.GetClientInfoByCode(info.Content.Provider);
         if (tempClient != null)
         {
         }
     }
     txtPurchasePlanBillCode.Text = info.Content.PurchaseBillCode;        //入库单号
     txtPurchasePlanDate.Text     = info.Content.PurchaseDate.ToString(); //入库日期
     lblOperator.Text             = user_idao.GetUserInfo(info.Content.Operator).Rows[0]["User_Name"].ToString();
 }
Ejemplo n.º 5
0
        /// <summary>
        ///   验证记录中是否有重复值
        /// </summary>
        /// <param name="info"> 实体 </param>
        /// <returns> 如果不重复返回"" </returns>
        public string ValidateRepeat(Base_ClientInfo info)
        {
            int cnt1 = dc.Base_ClientInfo.Where(itm => itm.ClientCode == info.ClientCode && itm.ID != info.ID).Count();

            if (cnt1 > 0)
            {
                return("代码重复");
            }
            int cnt2 = dc.Base_ClientInfo.Where(itm => itm.ShortName == info.ShortName && itm.ID != info.ID).Count();

            if (cnt2 > 0)
            {
                return("简称重复");
            }
            return("");
        }
Ejemplo n.º 6
0
 public bool UpdateInfo(Base_ClientInfo info)
 {
     return(dao.UpdateInfo(info));
 }
Ejemplo n.º 7
0
 public int InsertInfo(Base_ClientInfo info)
 {
     dc.Base_ClientInfo.InsertOnSubmit(info);
     dc.SubmitChanges();
     return(info.ID);
 }