Ejemplo n.º 1
0
 /// <summary>
 /// 更新入库单的状态(用于区分是否结款)
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateDeliverStatus(Purchase obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.purchase_info set status={0},confirm_time='{1}',money_onoff={2} where id={3}";
         sql   = string.Format(sql, obj.status, obj.confirm_time, obj.money_onoff, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int Update(error_config_person obj)
 {
     try
     {
         int    count = 0;
         string sql   = "Update andon.error_config_person set class_no='{0}',error_config_id={1},person_level={2},person_id={3} where id={4}";
         sql   = string.Format(sql, obj.class_no, obj.error_config_id, obj.person_level, obj.person_id, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(Store obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.store_info set store_name='{0}' where id={1}";
         sql   = string.Format(sql, obj.store_name, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(material_category obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update fimp.material_category set type_code='{0}',type_name='{1}',unit_no='{2}',line_id={3},remark='{4}',createtime='{5}' where id={6}";
         sql   = string.Format(sql, obj.type_code, obj.type_name, obj.unit_no, obj.line_id, obj.remark, DateTime.Now.AddHours(GlobalDefine.SysTimeZone), obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(Material obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.material_info set price='{0}',picture='{1}' where id={2}";
         sql   = string.Format(sql, obj.price, obj.picture, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateStatus(int id, string confirm_time, int pay_type)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.invoice_info set status=1,confirm_time='{0}',pay_type={1} where id={2}";
         sql   = string.Format(sql, confirm_time, pay_type, id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 关联发票更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(DuiZhang obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.duizhang_info set invoice_index='{0}',invoice_time='{1}' where id={2}";
         sql   = string.Format(sql, obj.invoice_index, obj.invoice_time, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateDeliverHead(string deliver_company_head, string deliver_index)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.sale_info set deliver_company_head='{0}' where deliver_index='{1}'";
         sql   = string.Format(sql, deliver_company_head, deliver_index);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 更新信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(machine_working_time obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update fimp.machine_working_time set machine_id={0},plant_id={1},unit_no='{2}',line_id={3},station_id={4},part_num='{5}',standard_time={6} where id={7}";
         sql   = string.Format(sql, obj.machine_id, obj.plant_id, obj.unit_no, obj.line_id, obj.station_id, obj.part_num, obj.standard_time, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateMoney(Sale obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.sale_info set money_onoff={0},money_way={1} where deliver_index='{2}' and seq_id={3} ";
         sql   = string.Format(sql, obj.money_onoff, obj.money_way, obj.deliver_index, obj.seq_id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 更新人员信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(user obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update fimp.user set user_name='{0}',user_level='{1}' where id={2}";
         sql   = string.Format(sql, obj.user_name, obj.user_level, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(Contact obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.customer_info set name='{0}',position='{1}',telephone='{2}',email='{3}' where id={4}";
         sql   = string.Format(sql, obj.name, obj.position, obj.telephone, obj.email, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 更新信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(area_info obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update fimp.area_info set area_name_en='{0}',area_name_tw='{1}',area_name_cn='{2}',time_zone='{3}' where area_id={4}";
         sql   = string.Format(sql, obj.area_name_en, obj.area_name_tw, obj.area_name_cn, obj.time_zone, obj.area_id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 修改密码
 /// </summary>
 /// <param name="user_name">账户</param>
 /// <param name="pass_word">密码</param>
 /// <returns></returns>
 public int UpdatePassWord(string user_name, string pass_word)
 {
     try
     {
         pass_word = SS.Base64Encryption(Encoding.UTF8, pass_word);
         string sql = "update jinchen.user_info set pass_word='{0}' where user_name='{1}'";
         sql = string.Format(sql, pass_word, user_name);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 更新人员信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(User obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.user_info set user_name='{0}',level={1},level_name='{2}' where id={3}";
         sql   = string.Format(sql, obj.user_name, obj.level, obj.level_name, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 16
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(SaleReturn obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.salereturn_info set return_num={0},return_price={1},return_all_price={2},remark='{3}' where seq_id={4} and return_index='{5}' ";
         sql   = string.Format(sql, obj.return_num, obj.return_price, obj.return_all_price, obj.remark, obj.seq_id, obj.return_index);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateReturnStatus(string return_index, int seq_id)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.salereturn_info set return_status=1,confirm_time='{0}' where return_index='{1}' and seq_id={2} ";
         sql   = string.Format(sql, DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:ss:mm"), return_index, seq_id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 18
0
 public int Del(DateTime start_time, DateTime end_time)
 {
     try
     {
         int    count = 0;
         string sql   = "delete from andon.error_log_person where insert_time>='{0}' and insert_time<='{1}'";
         sql   = string.Format(sql, start_time, end_time);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 19
0
 public int Insert(error_quality_log obj)
 {
     try
     {
         string sql = "Insert into andon.error_quality_log(error_log_id,error_type_id,station_id,machine_code,defectives_count,quality_description,quality_reason,improve_plan,plan_date,responsible_person,remark,insert_time)" +
                      "values({0},{1},{2},'{3}',{4},'{5}','{6}','{7}','{8}','{9}','{10}','{11}')";
         sql = string.Format(sql, obj.error_log_id, obj.error_type_id, obj.station_id, obj.machine_code, obj.defectives_count, obj.quality_description, obj.quality_reason, obj.improve_plan, obj.plan_date, obj.responsible_person, obj.remark, obj.insert_time);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 20
0
 public int Del(int id)
 {
     try
     {
         int    count = 0;
         string sql   = "delete from andon.error_log_person where id={0}";
         sql   = string.Format(sql, id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 /// 更新对账单号
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateInvoiceIndex(string invoice_index, string deliver_index, int seq_id)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.sale_info set invoice_index='{0}' where deliver_index='{1}' and seq_id='{2}'";
         sql   = string.Format(sql, invoice_index, deliver_index, seq_id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 重置密码
 /// </summary>
 /// <param name="user_name"></param>
 /// <returns></returns>
 public int ResetPassWord(string user_name)
 {
     try
     {
         string pass_word = SS.Base64Encryption(Encoding.UTF8, "111111");
         string sql       = "update  fimp.user set pass_word='{0}' where user_name='{1}'";
         sql = string.Format(sql, pass_word, user_name);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 更新对账数量
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateDZNum(double dz_num, int id)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.sale_info set dz_num={0} where id ={1}";
         sql   = string.Format(sql, dz_num, id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 24
0
 /// <summary>
 /// 对账时若货物存在退货则标识一下
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateReturnFlag(string deliver_index, int seq_id)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.sale_info set return_flag=1 where deliver_index='{0}' and seq_id={1}";
         sql   = string.Format(sql, deliver_index, seq_id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 更新信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(material_info obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update fimp.material_info set category_id={0},material_code='{1}',material_name='{2}',material_type='{3}',material_inventory={4},remark='{5}',createtime='{6}' where id={7}";
         sql   = string.Format(sql, obj.category_id, obj.material_code, obj.material_name, obj.material_type, obj.material_inventory, obj.remark, obj.createtime, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int UpdateDeliverDetails(Sale obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update jinchen.sale_info set real_num={0},remark='{1}',deliver_price={2},deliver_all_price={3}, deliver_company_head='{4}',insert_time='{5}' where seq_id={6} and deliver_index='{7}'";
         sql   = string.Format(sql, obj.real_num, obj.remark, obj.deliver_price, obj.deliver_all_price, obj.deliver_company_head, obj.insert_time, obj.seq_id, obj.deliver_index);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// 按照时间定期删除记录
        /// </summary>
        /// <param name="station_id">站位编号</param>
        /// <param name="end_time">结束时间</param>
        /// <returns></returns>
        public int DelByTime(DateTime datetime)
        {
            int count = 0;

            try
            {
                string comm;
                comm  = string.Format("delete FROM {0} where start_time<='{1}'", "fimp.ct", datetime);
                count = PostgreHelper.ExecuteNonQuery(comm);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(count);
        }
Ejemplo n.º 28
0
 /// <summary>
 /// 插入
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Insert(SaleReturn obj)
 {
     try
     {
         string sql = "insert into jinchen.salereturn_info(seq_id,return_index,return_num," +
                      "return_time,return_price,return_all_price,insert_time,deliver_index,remark) values({0},'{1}',{2},'{3}',{4},{5},'{6}','{7}','{8}')";
         sql = string.Format(sql, obj.seq_id, obj.return_index,
                             obj.return_num, obj.return_time, obj.return_price, obj.return_all_price, obj.insert_time, obj.deliver_index, obj.remark);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 29
0
 /// <summary>
 /// 插入
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Insert(Sale obj)
 {
     try
     {
         string sql = "insert into jinchen.sale_info(order_id,seq_id,deliver_index,deliver_company_head,real_num," +
                      "deliver_price,deliver_all_price,insert_time,remark) values({0},{1},'{2}','{3}',{4},{5},{6},'{7}','{8}')";
         sql = string.Format(sql, obj.order_id, obj.seq_id, obj.deliver_index,
                             obj.deliver_company_head, obj.real_num, obj.deliver_price, obj.deliver_all_price, obj.insert_time, obj.remark);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 30
0
 /// <summary>
 /// 插入
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int InsertOrderSeq(Order obj)
 {
     try
     {
         string sql = "insert into jinchen.orderseq_info(order_id,order_time,order_name,order_num," +
                      "order_price,order_all_price,remain_num,deliver_time,unit,purchase_person,order_picture,remark) values({0},'{1}','{2}',{3},{4},{5},{6},'{7}','{8}','{9}','{10}','{11}')";
         sql = string.Format(sql, obj.order_id, obj.order_time, obj.order_name, obj.order_num,
                             obj.order_price, obj.order_all_price, obj.order_num, obj.deliver_time, obj.unit, obj.purchase_person, obj.order_picture, obj.remark);//插入数据时,订单数量与剩余数量一致
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 31
0
Archivo: Demo.cs Proyecto: 89sos98/LBC
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            IDBHelper dbHelper = new PostgreHelper();
            string connectionString = "User ID=postgres;Password=admin;Server=192.168.0.226;Port=5432;Database=MonitorDB;";
            string sql = "insert into [RawLog]([ProjectID],[File],[Note]) values('项目编号',@file,'备注')";

            string file = this.textBox1.Text;
            if (!File.Exists(file)) return;

            //获取文件二进制流
            System.IO.FileStream fs = new System.IO.FileStream(file, System.IO.FileMode.Open);
            BinaryReader br = new BinaryReader(fs);
            byte[] b = br.ReadBytes((int)fs.Length);
            fs.Close();

            int r = dbHelper.ExecuteNonQuery(connectionString, CommandType.Text, sql, new Npgsql.NpgsqlParameter("@file", raw_log.File));
        }